This is the first significant library I’ve written in OCaml so any advice on ways to improve it would be greatly appreciated. There are still quite a few features I’d like to add but the basics are working.
Given the state of concurrency in Ocaml, I would break the API up into a pure one, which takes bytes and gives back a list of frames and one that takes frames and gives back bytes. That way a user can utilize whatever concurrency layer makes sens for them (perhaps no concurrency at all if they just are reading and writing a single socket. An example of this style can be seen in ocaml-tls Engine module. @dbuenzli also has several examples of how to do this which he makes use of in, for example, his Unicode libraries.