>>=
Option.bind
m-bind
do
& <-
maybe {}
& let!
domonad
Your friend asks "What does that do?"Your choices: 1. Oh, that's the Maybe monad!Your answer: 1
Your friend asks "What does that do?"Your choices: 1. Oh, that's the Maybe monad! 2. It chains together two functions that may or may not produce a value.
Your answer: 2
Monadic bind
/ >>=
1: 2: 3: |
|
Applicative apply
/ <*>
1: 2: 3: |
|
A monad is a structure that defines how to chain its operations together so that those operations compose sanely.