September 2018
Intermediate to advanced
302 pages
7h 17m
English
More formally, the monad interface should define two basic operators:
In these terms, our constructor function is the return function. However, our map function is not compliant with the bind requirements. It takes a function that turns a into b (a -> b), then our map function automatically wraps b into M b.
Beside this, our monad needs to obey three monad laws:
// for all x, fnMaybe(x).map(fn) == Maybe(fn(x))
// for all xMaybe(x).map(x ...
Read now
Unlock full access