fvilante / NextRobot

The next robot framework
0 stars 0 forks source link

Future_.fromResult( ... ) should require a lazy function instead just a Result ? #41

Open fvilante opened 4 years ago

fvilante commented 4 years ago

Why not

Future_.fromResult( r )

instead of

Future_.fromResult( () => r)

?

fvilante commented 4 years ago

It seems that Scala's ZIO uses lazy construction. But I may be doing a wrong reading of Scala language. Check it when possible:

  final def fromEither[E, A](v: => Either[E, A]): IO[E, A] =
    effectTotal(v).flatMap(_.fold(fail, succeed))