the calculation. That is, the desired behavior should be like this:
# lift ( + ) (lift ( / ) (unit 20) (unit 2))
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 ( * ) (unit 2) (unit 3)) 0;;
+ - : int * int = (16, 3)
Here, `lift` is the function that uses `bind` to prepare an ordinary
arithmetic operator (such as addition `( + )`, division `( / )`, or
Here, `lift` is the function that uses `bind` to prepare an ordinary
arithmetic operator (such as addition `( + )`, division `( / )`, or
your solution).
You'll need to define a computation monad type, unit, bind, and lift.
your solution).
You'll need to define a computation monad type, unit, bind, and lift.
2. Prove that your monad satisfies the monad laws. First, give
examples illustrating specific cases in which the monad laws are
2. Prove that your monad satisfies the monad laws. First, give
examples illustrating specific cases in which the monad laws are