Skip to content

Instantly share code, notes, and snippets.

@polyglotpiglet
Last active April 5, 2020 09:26
Show Gist options
  • Save polyglotpiglet/b9f4340a7411a7ceb8141c586f8290d9 to your computer and use it in GitHub Desktop.
Save polyglotpiglet/b9f4340a7411a7ceb8141c586f8290d9 to your computer and use it in GitHub Desktop.
/*
Functor Laws:
1. Identity
fa.map(a => a) == fa
2. Composition
fa.map(f).map(g) = fa.map(g(f(_)))
*/
trait MyFunctor[F[_]] {
def map[A, B](fa: F[A], f: A => B): F[B]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment