X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?a=blobdiff_plain;f=topics%2Fweek7_introducing_monads.mdwn;h=adcf0cc2d42333ff35f1311dca7d215d2aa95cb9;hb=787297d94b859a55fc0ae9c2f9ff1fa301fb0460;hp=81ccafb2ccd3729ab970574b98cc3b6a8af8468a;hpb=a914ff0ed48112619a514100394a5f2a0fcbc132;p=lambda.git 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