Created
October 20, 2018 21:02
-
-
Save xekoukou/4392e15c7b424c56d6ccf4e9a08f1ba9 to your computer and use it in GitHub Desktop.
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
let pack ls = | |
let buf = Buffer.create (List.length ls) in | |
let e = Uutf.encoder utf8 (`Buffer buf) | |
in let rec loop ls = match ls with | |
| [] -> Buffer.contents buf | |
| (c :: ls) -> print_string (Buffer.contents buf) ; let _ = Uutf.encode e (`Uchar c) in () ; loop ls | |
in loop ls |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment