Skip to content

Instantly share code, notes, and snippets.

@Chouser
Created January 27, 2015 22:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Chouser/27306a7cb653a9a11d1c to your computer and use it in GitHub Desktop.
Save Chouser/27306a7cb653a9a11d1c to your computer and use it in GitHub Desktop.
let slurp filename =
let ic = open_in filename in
let rec loop out_str =
try
loop out_str ^ (input_line ic) ^ "\n"
with e ->
close_in ic;
out_str in
loop ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment