Lars Hupel
unread,Jun 1, 2012, 12:53:29 PM6/1/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sca...@googlegroups.com
`OptionT[F, T]` is basically equivalent to `F[Option[T]]`. If `F` is a
monad, then so is `OptionT[F, _]`.
However, it is not as easy as a simple `flatMap`, because for that, your
`f` has to have the type
String => OptionT[VS, Int]
Your `f` has the type
String => VS[Int]
Thus, you have to `lift` the result type of `f` into `OptionT` (or you
can rewrite `f`. `OptionT` has a `Pure` instance, so this should be easy).