projects
/
lambda.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
zippers: spaces
[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
02f3b15
..
9c1079c
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 (
x : 'a) = fun (r, h) -> (x
, r, h);;
+ let unit_dpm (
value : 'a) : 'a dpm = fun (r, h) -> (value
, r, h);;
- let bind_dpm (u : 'a dpm) (f : 'a -> 'b dpm) =
+ let bind_dpm (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