[MLton-user] IOType 1.0, binary serialization preprocessor

Christopher Cramer tsuyoshi at yumegakanau.org
Tue Aug 23 13:00:47 PDT 2011


Hi

I've just released the version 1.0 of IOType, which is a Standard ML
preprocessor that generates binary serialization functions from type
definitions.

It extends SML to add three new keywords: iotype, ioeqtype, and
iodatatype, which correspond to the SML keywords type, eqtype,
and datatype. By adding "io", you instruct the preprocessor to emit
the type definition (without the "io"), as well as specifications and
functions for reading and writing that type.

Given a definition such as:

        iotype foo = ...

it will emit in a signature:

        type foo = ...
        val readFoo: BinIO.instream -> foo option
        val writeFoo: BinIO.outstream * foo -> unit

and in a structure:

        type foo = ...
        fun readFoo p = ...
        fun writeFoo (p, x) = ...

A library is also included that provides serialization functions for
Basis Library types (such as int, char, string, vector, etc.).

The source code and Debian i386 packages are available at
http://yumegakanau.org/code/iotype/



More information about the MLton-user mailing list