Oℕ
Size: a a a
Oℕ
λ
VS
VS
VS
λ
VS
def splitErrors[```
T[_]: Traverse: Alternative,
F[_]: Functor, G[_]: Applicative, E, A](ls: T[F[A]])(
implicit errors: ErrorsTo[F, G, E]
): G[(T[E], T[A])] =
ls.traverse(_.attemptTo[G, E]).map(_.partitionEither(identity))
def parseInt[F[_]: Applicative: Raise[*[_], String]](s: String): F[Int] =
s.toIntOption.orRaise(s"could not parse $s")
type Calc[A] = EitherT[Eval, String, A]
splitErrors[Vector, Calc, Eval, String, Int](
Vector("1", "hello", "2", "world", "3").map(parseInt[Calc])
).value
w
def splitErrors[```
T[_]: Traverse: Alternative,
F[_]: Functor, G[_]: Applicative, E, A](ls: T[F[A]])(
implicit errors: ErrorsTo[F, G, E]
): G[(T[E], T[A])] =
ls.traverse(_.attemptTo[G, E]).map(_.partitionEither(identity))
def parseInt[F[_]: Applicative: Raise[*[_], String]](s: String): F[Int] =
s.toIntOption.orRaise(s"could not parse $s")
type Calc[A] = EitherT[Eval, String, A]
splitErrors[Vector, Calc, Eval, String, Int](
Vector("1", "hello", "2", "world", "3").map(parseInt[Calc])
).value
w
def splitErrors[```
T[_]: Traverse: Alternative,
F[_]: Functor, G[_]: Applicative, E, A](ls: T[F[A]])(
implicit errors: ErrorsTo[F, G, E]
): G[(T[E], T[A])] =
ls.traverse(_.attemptTo[G, E]).map(_.partitionEither(identity))
def parseInt[F[_]: Applicative: Raise[*[_], String]](s: String): F[Int] =
s.toIntOption.orRaise(s"could not parse $s")
type Calc[A] = EitherT[Eval, String, A]
splitErrors[Vector, Calc, Eval, String, Int](
Vector("1", "hello", "2", "world", "3").map(parseInt[Calc])
).value
VS
NV
def parseInt[F[_]: Applicative: Raise[*[_], String]](s: String): F[Int] =
s.toIntOption.orRaise(s"could not parse $s")
NV
D
Oℕ
λ
GP
R