Recall that a monad requires a singleton function `mid : P-> MP`, and a
composition operator `>=> : (P->MQ) -> (Q->MR) -> (P->MR)`. The type for
the composition operator stated here corrects a typo in the class handout.
Recall that a monad requires a singleton function `mid : P-> MP`, and a
composition operator `>=> : (P->MQ) -> (Q->MR) -> (P->MR)`. The type for
the composition operator stated here corrects a typo in the class handout.
is better. (Think of it as "m" plus "identity", not as the start of "midway".)
We will also move freely back and forth between using `>=>` and using `<=<` (aka `mcomp`), which
is better. (Think of it as "m" plus "identity", not as the start of "midway".)
We will also move freely back and forth between using `>=>` and using `<=<` (aka `mcomp`), which
(If you have trouble keeping straight what is the OCaml terminology for this and what is the Haskell terminology, don't worry, we do too.)
(If you have trouble keeping straight what is the OCaml terminology for this and what is the Haskell terminology, don't worry, we do too.)
(or reconstruct) either of the composition operators `>=>` or `<=<`.
Show that your composition operator obeys the Monad Laws.
(or reconstruct) either of the composition operators `>=>` or `<=<`.
Show that your composition operator obeys the Monad Laws.