Created
December 21, 2016 10:07
-
-
Save fomkin/837543c5661b79a975c3a5f4c303a76b to your computer and use it in GitHub Desktop.
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
trait Async[F[_]] { | |
def pure[A](value: => A): F[A] | |
def promise[A]: Async.Promise[F, A] | |
def flatMap[A, B](m: F[A])(f: A => F[B]): F[B] | |
def map[A, B](m: F[A])(f: A => B): F[B] | |
def run[A, U](m: F[A])(f: Try[A] => U): Unit | |
} | |
object Async { | |
case class Promise[F[_], A](future: F[A], complete: Try[A] => Unit) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment