Skip to content

Instantly share code, notes, and snippets.

@xuwei-k
Created November 6, 2022 09:35
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 xuwei-k/ee0d43d3d2e325e6bf31926ea2f2e716 to your computer and use it in GitHub Desktop.
Save xuwei-k/ee0d43d3d2e325e6bf31926ea2f2e716 to your computer and use it in GitHub Desktop.
trait Functor[F[_]]
def map [A, B](fa: F[A])(f: A => B ): F[B]
trait Applicative[F[_]]
def ap [A, B](fa: F[A])(f: F[A => B]): F[B]
trait Monad[F[_]]
def bind [A, B](fa: F[A])(f: A => F[B]): F[B]
trait Contravariant[F[_]]
def contramap[A, B](fa: F[A])(f: B => A ): F[B]
trait Comonad[F[_]]
def cobind [A, B](fa: F[A])(f: F[A] => B ): F[B]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment