Created
November 11, 2015 13:12
-
-
Save cljoly/9838acf31373ac048b5b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
let i = Reader.open_file "each.pi";; | |
let o = Writer.open_file "each.pi.out";; | |
o >>= (fun o -> i >>= (fun i -> Reader.read_one_chunk_at_a_time i ~handle_chunk:(fun | |
str ~pos ~len -> | |
printf "Pos: %i, Len: %i" pos len; | |
Bigstring.to_string str | |
|> String.filter ~f:(function '\n' | '\r' | ' ' -> false | _ -> true) | |
|> Bigstring.of_string | |
|> Writer.write_bigstring o; | |
return `Continue)));; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment