Last active
December 16, 2015 02:19
-
-
Save seanparsons/5361916 to your computer and use it in GitHub Desktop.
Experimenting with sequenceU
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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