From: jim Date: Fri, 20 Mar 2015 13:14:34 +0000 (-0400) Subject: = to == X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=commitdiff_plain;h=b1ced32e0ccd66737ef9ad8b038df32656865ae3;ds=sidebyside = to == --- diff --git a/topics/week7_introducing_monads.mdwn b/topics/week7_introducing_monads.mdwn index 57afcb97..5f822866 100644 --- a/topics/week7_introducing_monads.mdwn +++ b/topics/week7_introducing_monads.mdwn @@ -184,7 +184,7 @@ has to obey the following Map Laws: >
join ○ (map join) == join ○ join
join ○ mid == id == join ○ map mid
> The first of these says that if you have a triply-boxed type, and you first merge the inner two boxes (with `map join`), and then merge the resulting box with the outermost box, that's the same as if you had first merged the outer two boxes, and then merged the resulting box with the innermost box. The second law says that if you take a box type and wrap a second box around it (with `mid`) and then merge them, that's the same as if you had instead mapped a second box around the elements of the original (with `map mid`, leaving the original box on the outside), and then merged them.

> The Category Theorist would state these Laws like this, where `M` is the endofunctor that takes us from type `α` to type α: - >

μ ○ M(μ) == μ ○ μ
μ ○ η = id == μ ○ M(η)
+ >
μ ○ M(μ) == μ ○ μ
μ ○ η == id == μ ○ M(η)
Here are some interdefinitions: TODO