diff options
| author | Vladimir Azarov <avm@intermediate-node.net> | 2025-05-30 15:49:48 +0200 |
|---|---|---|
| committer | Vladimir Azarov <avm@intermediate-node.net> | 2025-05-30 15:49:48 +0200 |
| commit | 246df63a73a1a583284e38e61f94ed4ac0874ece (patch) | |
| tree | aa48f75e1fc346c93175f8a824f62074eeb8cc0c /common.sml | |
| parent | c0599bcbb92af9cbaea52af3560ae08009d1b09d (diff) | |
Statements
Diffstat (limited to 'common.sml')
| -rw-r--r-- | common.sml | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -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 |
