X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?a=blobdiff_plain;ds=inline;f=topics%2Fweek7_introducing_monads.mdwn;h=adcf0cc2d42333ff35f1311dca7d215d2aa95cb9;hb=03bae43bc16f1f8dc98cfe2dab15264bc129beb1;hp=75d0cee4d9912ecb28b9a0b5c6fcf8b91d1bb50d;hpb=99724b7a28e23caa99552af55797f16b3c4666b3;p=lambda.git diff --git a/topics/week7_introducing_monads.mdwn b/topics/week7_introducing_monads.mdwn index 75d0cee4..adcf0cc2 100644 --- a/topics/week7_introducing_monads.mdwn +++ b/topics/week7_introducing_monads.mdwn @@ -107,11 +107,11 @@ Here are the types of our crucial functions, together with our pronunciation, an <=< or mcomp : (Q -> R) -> (P -> Q) -> (P -> R) ->=> or mpmoc (flip mcomp): (P -> Q) -> (Q -> R) -> (P -> R) +>=> (flip mcomp, should we call it mpmoc?): (P -> Q) -> (Q -> R) -> (P -> R) >>= or mbind : (Q) -> (Q -> R) -> (R) -=<< or mdnib (flip mbind) (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