diff options
Diffstat (limited to 'common.sml')
-rw-r--r-- | common.sml | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -179,6 +179,16 @@ type ('t1, 't2, 'a, 'b, 'c) a2printer = (bool * ((string -> unit) * 'a)) * 'b -> 't1 -> 't2 -> ((bool * ((string -> unit) * 'a)) * 'b -> 'c) -> 'c +val Popt = fn z => +let + fun f (out, p, v) = + case v of + NONE => Printf out `"none" % + | SOME v => Printf out p v % +in + bind A2 f +end z + fun die code g = let fun finish (true, _) = raise Unreachable |