summaryrefslogtreecommitdiff
path: root/common.sml
diff options
context:
space:
mode:
Diffstat (limited to 'common.sml')
-rw-r--r--common.sml11
1 files changed, 7 insertions, 4 deletions
diff --git a/common.sml b/common.sml
index 788c28b..75ed15e 100644
--- a/common.sml
+++ b/common.sml
@@ -184,11 +184,14 @@ type ('t1, 't2, 'a, 'b, 'c) a2printer =
(bool * ((string -> unit) * 'a)) * 'b -> 't1 -> 't2 ->
((bool * ((string -> unit) * 'a)) * 'b -> 'c) -> 'c
-fun popt p v out =
+fun poptInternal addSpace none p v out =
case v of
- NONE => Printf out `"none" %
- | SOME v => Printf out A1 p v %
-val Popt = fn z => bind A2 popt z
+ NONE => Printf out `none %
+ | SOME v => Printf out A1 p v `(if addSpace then " " else "") %
+
+fun poptN z = poptInternal false z
+val Popt = fn z => bind A2 (poptInternal false "") z
+val PoptS = fn z => bind A2 (poptInternal true "") z
fun plist p l (s, parens) out =
let