This library is a set of APIs defined with module types, and a set of modules and functors implementing one or more of those interfaces.
The APIs define what a character and a string of characters should be.
The library is “packed” in the
Sosa toplevel module name.
We have, in the sub-module
BASIC_CHARACTER: characters of any length.
NATIVE_CONVERSIONS: functions to transform from/to native OCaml strings.
BASIC_STRING: immutable strings of (potentially abstract) characters:
UNSAFELY_MUTABLE: mutability of some string implementations (“unsafe” meaning that they break immutability invariants/assumptions).
MINIMALISTIC_MUTABLE_STRING: abstract mutable string used as argument of the
Native_character module implements
Native_string module implements
BASIC_STRING with OCaml's
considered immutable (and hence
Int_utf8_character module implements
OCaml integers (
int) representing Utf8 characters (we force the
handling of not more than 31 bits, even if RFC 3629
restricts them to end at U+10FFFF, c.f. also
wikipedia). Note that the function
only ASCII whitespace (useful while writing parsers for example).
See the file
test/main.ml for usage examples, the
library is tested with:
The tests depend on the Nonstd,
make test ./sosa_tests
and you may add the basic benchmarks to the process with: