ocaml/omd — pull request #113 by yallop (2014-05-15 13:52:42+00:00)
Title: Bigarray input support

Support for reading from a bigarray rather than from a string.

Since js_of_ocaml [supports bigarrays][js-of-ocaml-bigarray-support] nowadays, this should be pretty portable.

The [character-by-character extraction of a substring from a bigarray][sub] is probably rather inefficient, but I don't know if it's possible to do better without switching to C. (The more radical approach would be to parameterize the [token type][token] to use either bigarray or string for storing words.)

[js-of-ocaml-bigarray-support]: https://github.com/ocsigen/js_of_ocaml/commit/601be77d4
[sub]: https://github.com/yallop/omd/blob/67c316d94/src/omd_lexer.ml#L335-L343
[token]: https://github.com/ocaml/omd/blob/83c23ee/src/omd_representation.mli#L81-L169