summaryrefslogtreecommitdiff
path: root/stream.sml
diff options
context:
space:
mode:
authorVladimir Azarov <avm@intermediate-node.net>2025-05-30 11:42:15 +0200
committerVladimir Azarov <avm@intermediate-node.net>2025-05-30 11:42:15 +0200
commitc0599bcbb92af9cbaea52af3560ae08009d1b09d (patch)
tree482fec902413c950bec8c252fc7e52a2c34cf910 /stream.sml
parent8a8a17e19bc4d474436d518f10c4d2dc5314fc0d (diff)
New printf combinator interface
Diffstat (limited to 'stream.sml')
-rw-r--r--stream.sml10
1 files changed, 3 insertions, 7 deletions
diff --git a/stream.sml b/stream.sml
index 4d58911..aa8d0aa 100644
--- a/stream.sml
+++ b/stream.sml
@@ -28,13 +28,9 @@ structure Stream :> STREAM = struct
end
z
- val Ppos = fn z =>
- let
- fun p (out, Pos (fname, line, col)) =
- Printf out `fname `":" I line `":" I col %
- in
- bind A1 p
- end z
+ fun ppos (Pos (fname, line, col)) out =
+ Printf out `fname `":" I line `":" I col %
+ val Ppos = fn z => bind A1 ppos z
fun getchar (S as { contents, off, ... }: t) =
(String.sub (contents, off), updateStream S s#off (off + 1) %)