assignment7 tweaks
[lambda.git] / hints / assignment_7_hint_2.mdwn
index 96e4741..9c1079c 100644 (file)
@@ -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:
 
-               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
@@ -30,5 +30,5 @@
 
 *      A *possibility* for GS&V is a triple of an assignment function `r`, a store `h`, and a world `w`. We're dropping worlds so we'll call pairs `(r, h)` *discourse possibilities*. *dpm*s are monads that represent computations that may mutate---or in GS&V's terminology "extend"---discourse possibilities. An `'a dpm` is a function that takes a starting `(r, h)` and returns an `'a` and a possibly mutated `r'` and `h'`.
 
-*      Is that enough? If not, here are some [more hints](/hints/assignment_7_hint_3).
+*      Is that enough? If not, here are some [more hints](/hints/assignment_7_hint_3). But try to get as far as you can on your own.