summaryrefslogtreecommitdiff
path: root/common.sml
diff options
context:
space:
mode:
Diffstat (limited to 'common.sml')
-rw-r--r--common.sml10
1 files changed, 10 insertions, 0 deletions
diff --git a/common.sml b/common.sml
index e648203..d039471 100644
--- a/common.sml
+++ b/common.sml
@@ -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