RosettaCodeData/Task/Input-loop/Standard-ML/input-loop-1.ml

5 lines
128 B
OCaml
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
fun foldLines f init strm =
case TextIO.inputLine strm of
SOME line => foldLines f (f (line, init)) strm
| NONE => init