Last active
January 1, 2016 07:19
-
-
Save joost-de-vries/8110503 to your computer and use it in GitHub Desktop.
notes from Gilad Brachas talk wrt functor, monad, semigroup, monoid.The observation that a monoid is foldRightable is interesting.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a semigroup is addable | |
a monoid is foldRightable or aggregatable | |
(ie addable, zero) | |
a functor is mappable | |
a monad is chainable or flatmappable | |
strong suit of monads: | |
pipelining using a for comprehension, handle different outcomes, null, deferred outcomes until the first future completes etc | |
Erik Meijer calls this: focus on the happy path | |
a ring is multipliable | |
in addition to addable and additive zero | |
Kleisli arrows are a way of composing functions that return options etc without having to do a for comprehension | |
the monad contract: | |
new C(x).flatMap(f) == f(x); | |
c.flatMap((x)=> new C(x)) == c; | |
c.flatMap((x)=> f(x).flatMap(g)) == | |
c.flatMap(f).flatMap(g); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment