Skip to content

Instantly share code, notes, and snippets.

@fomkin
Created December 21, 2016 10:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fomkin/837543c5661b79a975c3a5f4c303a76b to your computer and use it in GitHub Desktop.
Save fomkin/837543c5661b79a975c3a5f4c303a76b to your computer and use it in GitHub Desktop.
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