Difference between revisions of "Talk:Don't fear the Monad"
(Created page with "=Broken symmetry causes confusion (with Monad) (start at 2400)= The following definition shows a structure asymmetry... M a >>= a -> M a The LHS and RHS across the <code>...") |
m (Benkoo moved page Talk:Don't be afraid of the Monad to Talk:Don't fear the Monad) |
(2 intermediate revisions by the same user not shown) | |
(No difference)
|
Latest revision as of 13:03, 1 September 2021
Broken symmetry causes confusion (with Monad) (start at 2400)
The following definition shows a structure asymmetry...
M a >>= a -> M a
The LHS and RHS across the >>=
operator has two different types.
In order to restore the symmetry, we need to put a expression (\a -> M a
) in front of the overall structure, to get back the world of compositions. We just have to put one little from the outside, the entire expression is back to our compositional universe. It is almost exactly the same as a Monoid.
\a -> ( M a >>= a -> M a )
{{#ev:youtube|ZhuHCtR3xq8|||| |start=2430&end=2442}}
The Definition of Monad: (start at 2442)
The functions \a -> M a
live in a Monoid and this data: M a
, live in a Monad, that's the definition. ... (because) we want compositionality, for the same reasons we mentioned before, we want our functions to live in a Monoid, but we need this extra data, so that we can do concurrency, side effects, I/O, whatever else ... (to make programs useful).
{{#ev:youtube|ZhuHCtR3xq8||||
|start=252&end=2577}}