September 2018
Intermediate to advanced
398 pages
9h 43m
English
Given a type F that has a Monad[F] instance, for all types A given an instance fa: F[A], the following equalities must be verified:
((fa flatMap f) flatMap g) == (fa flatMap(f(_) flatMap g))
Monad[F].pure(a).flatMap(f) == f(a)
Bringing a value in the F context and calling flatMap f should provide the same result as calling the function F directly.
fa.flatMap(Monad[F].pure) == fa
The fa object should not change when we call ...
Read now
Unlock full access