Skip to content

Instantly share code, notes, and snippets.

@mmollaverdi
Created October 27, 2016 17:56
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 mmollaverdi/58750b3220d5bb146573c8022001bfbe to your computer and use it in GitHub Desktop.
Save mmollaverdi/58750b3220d5bb146573c8022001bfbe to your computer and use it in GitHub Desktop.
implicit val TaskApplicative = new Applicative[Task] {
override def ap[A, B](ff: Task[A => B])(fa: Task[A]): Task[B] = Task.mapBoth(ff, fa)((f, a) => f(a))
override def pure[A](x: A): Task[A] = Task.now(x)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment