Perl-style type-safe pack/unpack for OCaml