projects
/
lambda.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
commentary on ass6 solutions: post to new_stuff
[lambda.git]
/
hints
/
assignment_7_hint_2.mdwn
diff --git
a/hints/assignment_7_hint_2.mdwn
b/hints/assignment_7_hint_2.mdwn
index
d1736b3
..
29f6f05
100644
(file)
--- a/
hints/assignment_7_hint_2.mdwn
+++ b/
hints/assignment_7_hint_2.mdwn
@@
-20,9
+20,9
@@
Since `dpm`s are to be a monad, we have to define a unit and a bind. These are just modeled on the unit and bind for the State monad:
Since `dpm`s are to be a monad, we have to define a unit and a bind. These are just modeled on the unit and bind for the State monad:
- let
unit_dpm
(value : 'a) : 'a dpm = fun (r, h) -> (value, r, h);;
+ let
dpm_unit
(value : 'a) : 'a dpm = fun (r, h) -> (value, r, h);;
- let
bind_dpm
(u : 'a dpm) (f : 'a -> 'b dpm) : 'b dpm =
+ let
dpm_bind
(u : 'a dpm) (f : 'a -> 'b dpm) : 'b dpm =
fun (r, h) ->
let (a, r', h') = u (r, h)
in let u' = f a
fun (r, h) ->
let (a, r', h') = u (r, h)
in let u' = f a