Last active
August 29, 2015 14:04
-
-
Save theleoborges/1d1191933f6bb11a6eaa to your computer and use it in GitHub Desktop.
sequence, type lambdas and sequenceU
This file contains 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
case class Error(reason: String) | |
val eithers: List[\/[Error, String]] = List(\/-("Ok"), -\/(Error("notOk"))) | |
eithers.sequence | |
// error: could not find implicit value for parameter ev: scalaz.Leibniz.===[scalaz.\/[Error,String],G[B]] | |
eithers.sequence[({type λ[α] = \/[Error, α]})#λ, String] | |
// scalaz.\/[Error,List[String]] = -\/(Error(notOk)) | |
eithers.sequenceU | |
// scalaz.\/[Error,List[String]] = -\/(Error(notOk)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment