Last active
June 5, 2016 14:56
-
-
Save jto/76eed467a8ae2d3332ca to your computer and use it in GitHub Desktop.
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
import scalaz._ | |
import Scalaz._ | |
import scala.concurrent.Future | |
import scalaz.std.scalaFuture._ | |
import play.api.libs.concurrent.Execution.Implicits._ | |
val f1 = (s: String) => Option("foo").point[Future] | |
def f2 = (s: String) => Option(1).point[Future] | |
type OptionTFuture[T] = OptionT[Future, T] | |
for { | |
e1 <- Kleisli(f1).mapK[OptionTFuture, String](OptionT.apply _) | |
e2 <- Kleisli(f2).mapK[OptionTFuture, String](OptionT.apply _) | |
} yield e1 + e2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment