projects
/
lambda.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
edits
[lambda.git]
/
week7.mdwn
diff --git
a/week7.mdwn
b/week7.mdwn
index
62ef89f
..
9f139c1
100644
(file)
--- a/
week7.mdwn
+++ b/
week7.mdwn
@@
-62,8
+62,10
@@
that provides at least the following three elements:
* A bind operation (note the type):
* A bind operation (note the type):
+<pre>
let bind m f = match m with None -> None | Some n -> f n;;
val bind : 'a option -> ('a -> 'b option) -> 'b option = <fun>
let bind m f = match m with None -> None | Some n -> f n;;
val bind : 'a option -> ('a -> 'b option) -> 'b option = <fun>
+</pre>
`bind` takes two arguments (a monadic object and a function from
ordinary objects to monadic objects), and returns a monadic
`bind` takes two arguments (a monadic object and a function from
ordinary objects to monadic objects), and returns a monadic