From 03bae43bc16f1f8dc98cfe2dab15264bc129beb1 Mon Sep 17 00:00:00 2001 From: jim Date: Thu, 19 Mar 2015 18:43:03 -0400 Subject: [PATCH] add mappable laws --- topics/week7_introducing_monads.mdwn | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/topics/week7_introducing_monads.mdwn b/topics/week7_introducing_monads.mdwn index b3ab5aa9..adcf0cc2 100644 --- a/topics/week7_introducing_monads.mdwn +++ b/topics/week7_introducing_monads.mdwn @@ -127,7 +127,11 @@ certain useful guarantees. if there is a `map` function defined for that box type with the type given above. This has to obey the following Map Laws: - TODO LAWS + map (id : α -> α) = (id : α -> α) + map (g ○ f) = (map g) ○ (map f) + + Essentially these say that `map` is a homomorphism from `(α -> β, ○, id)` to (α -> β, ○', id'), where `○'` and `id'` are `○` and `id` restricted to arguments of type _. + * ***MapNable*** (in Haskelese, "Applicatives") A Mappable box type is *MapNable* if there are in addition `map2`, `mid`, and `mapply`. (Given either -- 2.11.0