diff options
Diffstat (limited to 'common.sml')
-rw-r--r-- | common.sml | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -194,7 +194,17 @@ fun bindWith2str to = bind A1 (fn v => fn (output, _) => output $ to v) fun F z = bind A0 (fn (_, mf) => mf ()) z -val I = fn z => bindWith2str Int.toString z +val I = fn z => +let + fun f v out = + if v >= 0 then + Printf out `(Int.toString v) % + else + Printf out `"-" `(Int.toString $ ~v) % +in + bind A1 f +end z + fun i v out = Printf out I v % val Ip = fn z => |