X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=assignment6.mdwn;h=7d10ab58e18dd1fb60386525465ed06028a1ff9e;hp=919ff24f246a565a8c13157d2ed56987b46263ee;hb=5eafd339063de2c77f30a7c9aea2ed1c09bc7673;hpb=01979f60c8474ffe20e4a1a20d59bfff5d3950c6;ds=sidebyside
diff --git a/assignment6.mdwn b/assignment6.mdwn
index 919ff24f..7d10ab58 100644
--- a/assignment6.mdwn
+++ b/assignment6.mdwn
@@ -2,12 +2,13 @@
build a system that will evaluate arithmetic expressions. Instead of
returning a simple integer as a result, it will deliver the correct
answer along with a count of the number of operations performed during
-the calculuation. That is, the desired behavior should be like this:
+the calculation. That is, the desired behavior should be like this:
- # lift ( + ) (lift ( / ) (unit 20) (unit 2)) (lift ( * ) (unit 2) (unit 3)) 0;;
- - : int * int = (16, 3)
+ # lift ( + ) (lift ( / ) (unit 20) (unit 2))
+ (lift ( * ) (unit 2) (unit 3)) 0;;
+ - : int * int = (16, 3)
-Here, `lift` is the function that uses `bind` to prepare an ordinary
+ Here, `lift` is the function that uses `bind` to prepare an ordinary
arithmetic operator (such as addition `( + )`, division `( / )`, or
multiplication `( * )`) to recieve objects from the counting monad as
arguments. The response of the interpreter says two things: that
@@ -16,11 +17,11 @@ steps. By the way, that zero at the end provides the monadic object
with a starting point (0 relevant computations have occurred previous
to the current computation).
-Assume for the purposes of this excercise that no one ever tries to
+ Assume for the purposes of this excercise that no one ever tries to
divide by zero (so there should be no int option types anywhere in
your solution).
-You'll need to define a computation monad type, unit, bind, and lift.
+ You'll need to define a computation monad type, unit, bind, and lift.
We encourage you to consider this hint: [[Assignment 6 Hint 1]].
2. Prove that your monad satisfies the monad laws. First, give