Howdy,
Iostream 0.2 was recently released on opam. Here’s the release itself.
Iostream is a library providing a small set of abstractions for I/O streams (!) over bytes
. With release 0.2, there are now 4 main types, all of them based on objects:
Iostream.In.t
for unbuffered inputs;Iostream.In_buf.t
for buffered inputs;Iostream.Out.t
for unbuffered outputs;Iostream.Out_buf.t
for buffered outputs.
I found out that having all these explicit types is better than picking only some of them. A In_buf.t
can act as a proper byte stream, exposing its internal slice of bytes so that it’s possible to implement line parsing and such. Thanks to the object types, In_buf.t
is a subtype of In.t
, and same goes for Out_buf.t
and Out.t
.
There is also a iostream-camlzip
library that implements stream encoding and decoding over these types.
link to the documentation.