Skip to content

Instantly share code, notes, and snippets.

@xekoukou xekoukou/
Created Oct 20, 2018

What would you like to do?
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
You can’t perform that action at this time.