You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
EitherT.pure (and EitherT.rightT) does not have the same behavior as EitherT.leftT
EitherT.rightTcalls EitherT.pure, which calls right(F.pure(b)), which results in EitherT(F.map(F.pure(b))(Right(_)))
EitherT.leftT calls EitherT(F.pure(Left(a)))
when using IO the execution of converting F[B] => F[Either[A, B]] is delayed until IO is run on EitherT.pure and EitherT.rightT and it is not delayed on EitherT.leftT
Is there a reason for having pure as an alias for rightT, and evaluating F.pure(a) and then converting it to a Right value with map instead of using EitherT(F.pure(Right(b)))?
The text was updated successfully, but these errors were encountered:
aherrmann13
changed the title
EitherT.pure does not immediately resolve the valueEitherT.pure does not call F.pure on the 'Right' value
Apr 19, 2020
EitherT.pure
(andEitherT.rightT
) does not have the same behavior asEitherT.leftT
EitherT.rightT
callsEitherT.pure
, which callsright(F.pure(b))
, which results inEitherT(F.map(F.pure(b))(Right(_)))
EitherT.leftT
callsEitherT(F.pure(Left(a)))
when using
IO
the execution of convertingF[B] => F[Either[A, B]]
is delayed until IO is run onEitherT.pure
andEitherT.rightT
and it is not delayed onEitherT.leftT
Is there a reason for having
pure
as an alias forrightT
, and evaluatingF.pure(a)
and then converting it to aRight
value withmap
instead of usingEitherT(F.pure(Right(b)))
?The text was updated successfully, but these errors were encountered: