summaryrefslogtreecommitdiff
path: root/common.sml
diff options
context:
space:
mode:
authorVladimir Azarov <avm@intermediate-node.net>2025-05-28 19:46:48 +0200
committerVladimir Azarov <avm@intermediate-node.net>2025-05-28 19:46:48 +0200
commitdce47d2de14608a20f5d0afeb9c6271fd203c9b1 (patch)
treeac4056cfd98bbdb707bcf32719cea92824f7d7ca /common.sml
parent3a32398248e5593b1b536c837478cab276f7aebf (diff)
Declaration
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