Understanding monad transformers in Scala

Viewed 1209

I'm trying to understand how to use Monad Transformers. I read the wiki article about it and still have some questions.

We have IO monad that needs to read input from user. But the input is not always provided. So it's Option. To simplify we can define a monad OptionT which "incapsulates" actions of IO monad.

In my particular case I have two monads of types Future[Option[String]] and Future[List[Int]]. It means to simplify it I need two different transformers ListT[T] and OptionT[T] for each monad type respectively in which I embed Future behavior... Right?

1 Answers
Related