Skip to content

Instantly share code, notes, and snippets.

@VitorLuizC
Created April 27, 2020 19:03
Show Gist options
  • Save VitorLuizC/212299a9da159005840aa6ea4f63a69c to your computer and use it in GitHub Desktop.
Save VitorLuizC/212299a9da159005840aa6ea4f63a69c to your computer and use it in GitHub Desktop.
interface Monad<T> {
ap<U>(monad: Monad<(value: T) => U>): Monad<U>;
map<U>(fn: (value: T) => U): Monad<T>;
chain<U>(fn: (value: T) => Monad<U>): Monad<U>;
static of<T>(value: T): Monad<T>;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment