Skip to content

Instantly share code, notes, and snippets.

@seanparsons
Last active December 16, 2015 02:19
Show Gist options
  • Save seanparsons/5361916 to your computer and use it in GitHub Desktop.
Save seanparsons/5361916 to your computer and use it in GitHub Desktop.
Experimenting with sequenceU
scala> import scalaz._,Scalaz._,effect._
import scalaz._
import Scalaz._
import effect._
scala> val list = List(IO(1).liftM[OptionT])
list: List[scalaz.OptionT[scalaz.effect.IO,Int]] = List(OptionT(scalaz.effect.IOFunctions$$anon$5@52f3b59))
scala> list.sequenceU
res4: G.M[List[G.A]] = OptionT(scalaz.effect.IOFunctions$$anon$5@3beab0fc)
scala> val sequenced: OptionT[IO, List[Int]] = list.sequenceU
<console>:17: error: type mismatch;
found : G.M[List[G.A]]
required: scalaz.OptionT[scalaz.effect.IO,List[Int]]
val sequenced: OptionT[IO, List[Int]] = list.sequenceU
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment