_ -> Some (x / y);;
(*
-val div : int -> int -> int option = <fun>
+val div : int -> int -> int option = fun
# div 12 3;;
- : int option = Some 4
# div 12 0;;
This starts off well: dividing 12 by 3, no problem; dividing 12 by 0,
just the behavior we were hoping for. But we want to be able to use
-the output of the safe division function as input for further division
+the output of the safe-division function as input for further division
operations. So we have to jack up the types of the inputs:
<pre>
*)
</pre>
-This works, but is somewhat disappointing: the `add` prediction
+This works, but is somewhat disappointing: the `add` operation
doesn't trigger any presupposition of its own, so it is a shame that
it needs to be adjusted because someone else might make trouble.
<pre>
let bind (x: int option) (f: int -> (int option)) =
- match x with None -> None | Some n -> f n;;
+ match x with None -> None |
+ Some n -> f n;;
let add (x: int option) (y: int option) =
bind x (fun x -> bind y (fun y -> Some (x + y)));;
Compare the new definitions of `add` and `div` closely: the definition
for `add` shows what it looks like to equip an ordinary operation to
-survive in a presupposition-filled world, and the definition of `div`
-shows exactly what extra needs to be added in order to trigger the
-no-division-by-zero presupposition.
+survive in dangerous presupposition-filled world. Note that the new
+definition of `add` does not need to test whether its arguments are
+None objects or real numbers---those details are hidden inside of the
+`bind` function.
+The definition of `div` shows exactly what extra needs to be said in
+order to trigger the no-division-by-zero presupposition.
+
+For linguists: this is a complete theory of a particularly simply form
+of presupposition projection (every predicate is a hole).