From: Chris Date: Thu, 19 Mar 2015 22:44:30 +0000 (-0400) Subject: Merge branch 'master' of main.jimpryor.net:/srv/lambda/lambda X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=commitdiff_plain;h=787297d94b859a55fc0ae9c2f9ff1fa301fb0460;hp=ea187cef2fbecef2991baeac77e0d79d768ce941 Merge branch 'master' of main.jimpryor.net:/srv/lambda/lambda --- diff --git a/topics/week7_introducing_monads.mdwn b/topics/week7_introducing_monads.mdwn index 81ccafb2..adcf0cc2 100644 --- a/topics/week7_introducing_monads.mdwn +++ b/topics/week7_introducing_monads.mdwn @@ -111,7 +111,7 @@ Here are the types of our crucial functions, together with our pronunciation, an >>= or mbind : (Q) -> (Q -> R) -> (R) -=<< (flip mbind, should we call it mdnib?) (Q) -> (Q -> R) -> (R) +=<< (flip mbind, should we call it mdnib?) (Q -> R) -> (Q) -> (R) join: P -> P @@ -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