Skip to content

Instantly share code, notes, and snippets.

@longliveenduro
Created September 27, 2013 15:22
Show Gist options
  • Select an option

  • Save longliveenduro/6730323 to your computer and use it in GitHub Desktop.

Select an option

Save longliveenduro/6730323 to your computer and use it in GitHub Desktop.
implicit val FutureFunctor = new Functor[Future] {
def map[A, B](a: Future[A])(f: A => B): Future[B] = a map f
}
implicit val FutureMonad = new Monad[Future] {
def point[A](a: => A): Future[A] = Future(a)
def bind[A, B](fa: Future[A])(f: (A) => Future[B]): Future[B] = fa flatMap f
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment