Skip to content

Instantly share code, notes, and snippets.

@tjheslin1
Created December 29, 2017 16:00
Show Gist options
  • Save tjheslin1/fbb8b37526ba9600ecd6de04f9b6353e to your computer and use it in GitHub Desktop.
Save tjheslin1/fbb8b37526ba9600ecd6de04f9b6353e to your computer and use it in GitHub Desktop.

Taken from scala-with-cats by Noel Welsh and Dave Gurnell

Definition of a Monad

  • pure, of type A => F[A]

pure abstracts over constructors, providing a way to create a new monadic context from a plain value.

  • flatMap, of type (F[A], A => F[B]) => F[B]

flatMap extracts the value from a context and generates the next context in the sequence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment