some refinements
[lambda.git] / topics / week7_introducing_monads.mdwn
index c7f658d..fc508a8 100644 (file)
@@ -128,7 +128,7 @@ Here are the types of our crucial functions, together with our pronunciation, an
 
 <code>m$ or mapply (/εm@plai/): <u>P -> Q</u> -> <u>P</u> -> <u>Q</u></code>
 
-> We'll use `m$` as a left-associative infix operator, reminiscent of (the right-associative) `$` which is just ordinary function application (also expressed by mere left-associative juxtaposition). In the class presentation Jim called `m$` `â\97\8f`. In Haskell, it's called `Control.Monad.ap` or `Control.Applicative.<*>`.
+> We'll use `m$` as a left-associative infix operator, reminiscent of (the right-associative) `$` which is just ordinary function application (also expressed by mere left-associative juxtaposition). In the class presentation Jim called `m$` `â\9a«`. In Haskell, it's called `Control.Monad.ap` or `Control.Applicative.<*>`.
 
 <code>&lt;=&lt; or mcomp : (Q -> <u>R</u>) -> (P -> <u>Q</u>) -> (P -> <u>R</u>)</code>
 
@@ -220,7 +220,9 @@ has to obey the following Map Laws:
         u >>= mid == u
         mid a >>= k == k a
 
-     Also, Haskell calls `mid` `return` or `pure`, but we've stuck to our terminology in this context.
+    (Also, Haskell calls `mid` `return` or `pure`, but we've stuck to our terminology in this context.) Some authors try to make the first of those Laws look more symmetrical by writing it as:
+
+        (A >>= \a -> B) >>= \b -> C == A >>= (\a -> B >>= \b -> C)
 
     > <small>In Category Theory discussion, the Monad Laws are instead expressed in terms of `join` (which they call `μ`) and `mid` (which they call `η`). These are assumed to be "natural transformations" for their box type, which means that they satisfy these equations with that box type's `map`:
     > <pre>map f ○ mid == mid ○ f<br>map f ○ join == join ○ map (map f)</pre>