Last active
August 29, 2015 14:17
-
-
Save isido/1c74e33e3bbfbad33ba2 to your computer and use it in GitHub Desktop.
SML snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun read_file in_stream = | |
let | |
fun loop ins = | |
case TextIO.inputLine ins of | |
SOME line => line :: loop ins | |
| NONE => [] | |
in | |
loop in_stream before TextIO.closeIn in_stream | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment