From 28c12de567214f348853ddb23e1a0bb23676c5f9 Mon Sep 17 00:00:00 2001 From: jim Date: Fri, 20 Mar 2015 09:13:36 -0400 Subject: [PATCH] refine Cat Theory notes --- topics/week7_introducing_monads.mdwn | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/topics/week7_introducing_monads.mdwn b/topics/week7_introducing_monads.mdwn index ec117aa4..57afcb97 100644 --- a/topics/week7_introducing_monads.mdwn +++ b/topics/week7_introducing_monads.mdwn @@ -182,7 +182,8 @@ has to obey the following Map Laws: >
map f ○ mid == mid ○ f
map f ○ join == join ○ map (map f)
> The Monad Laws then take the form: >
join ○ (map join) == join ○ join
join ○ mid == id == join ○ map mid
- > Or, as the Category Theorist would state it, where `M` is the endofunctor that takes us from type `α` to type α: + > 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(η)
-- 2.11.0