Merge branch 'master' of main.jimpryor.net:/srv/lambda/lambda
authorChris <chris.barker@nyu.edu>
Thu, 19 Mar 2015 22:44:30 +0000 (18:44 -0400)
committerChris <chris.barker@nyu.edu>
Thu, 19 Mar 2015 22:44:30 +0000 (18:44 -0400)
topics/week7_introducing_monads.mdwn

index 81ccafb..adcf0cc 100644 (file)
@@ -111,7 +111,7 @@ Here are the types of our crucial functions, together with our pronunciation, an
 
 <code>&gt;&gt;= or mbind : (<u>Q</u>) -> (Q -> <u>R</u>) -> (<u>R</u>)</code>
 
-<code>=&lt;&lt; (flip mbind, should we call it mdnib?) (<u>Q</u>) -> (Q -> <u>R</u>) -> (<u>R</u>)</code>
+<code>=&lt;&lt; (flip mbind, should we call it mdnib?) (Q -> <u>R</u>) -> (<u>Q</u>) -> (<u>R</u>)</code>
 
 <code>join: <span class="box2">P</span> -> <u>P</u></code> 
 
@@ -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
+    <code>map (id : α -> α) = (id : <u>α</u> -> <u>α</u>)</code>  
+    <code>map (g ○ f) = (map g) ○ (map f)</code>
+
+    Essentially these say that `map` is a homomorphism from `(α -> β, ○, id)` to <code>(<u>α</u> -> <u>β</u>, ○', id')</code>, where `○'` and `id'` are `○` and `id` restricted to arguments of type <code><u>_</u></code>.
+
 
 *   ***MapNable*** (in Haskelese, "Applicatives") A Mappable box type is *MapNable*
        if there are in addition `map2`, `mid`, and `mapply`.  (Given either