Skip to content

Instantly share code, notes, and snippets.

@kasperpeulen
Created November 19, 2020 10:14
Show Gist options
  • Save kasperpeulen/ed9f3e2de4ef0e10d15ca4be95ccd7a2 to your computer and use it in GitHub Desktop.
Save kasperpeulen/ed9f3e2de4ef0e10d15ca4be95ccd7a2 to your computer and use it in GitHub Desktop.
// Given
declare const monad: Monad<A>
declare function f(a: A): Monad<B>;
declare function g(b: B): Monad<C>;
// Then
flatMap(flatMap(monad, f), g) === flatMap(monad, (a) => flatMap(f(a), g))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment