assignment7 tweaks
[lambda.git] / hints / assignment_7_hint_2.mdwn
index 16e66e1..0b1c59f 100644 (file)
@@ -5,11 +5,14 @@
 
        However, since we haven't studied these, we will just combine the reader monad and the state monad in an ad hoc way. The easiest way to do this is to think of the assignment function and the store of reference cells as a combined state, which gets threaded through the computations in the same way that simple states did in your earlier homeworks.
 
-       We'll call these "discourse possibility monads," and let them have the following type:
+       We'll call these "discourse possibility monads," and type them as follows:
 
                type entity = Bob | Carol | Ted | Alice;;
+               let domain = [Bob; Carol; Ted; Alice];;
+               type var = char;;
+               type assignment = var -> int;; (* variables are bound to indexes into the store *)
                type store = entity list;;
-               type assignment = char -> int;; (* variables are bound to indexes into the store *)
+
                type 'a discourse_possibility = 
                        (* we ignore worlds *)
                        assignment * store -> 'a * assignment * store