On 03/07/2012 12:34 PM, Yaron Minsky wrote:
> Are you familiar with type-conv and the family of syntax-extensions that
> go along with it?  You can do thinks like:
> 
>     type t = { foo: int; bar: string }
>     with sexp, compare, bin_io
> 
> 
> and automatically get sexp-conversion functions, a comparison function,
> and binary protocol converters.  And type-conv has been used to build
> other type-directed functions by other people outside of Jane Street.
> 
> The latest version is available on bitbucket, and we'll have a new
> blessed release in a few days.
> 
>     https://bitbucket.org/yminsky/ocaml-core/
> 
> 
> Note that this is done purely syntactically, and yet gets you there.

I have looked at bin_prot and sexplib previously.
They are very nice and useful.

I have found one (I guess unnecessary) disadvantage over `deriving'.
If you process your *.ml file with sexplib/bin_prot preprocessor, you
have to append "with ..." suffix to every type definition, otherwise you
will get a an error report from the preprocessor. `Deriving' does not
force you to do that. You can annotate only those type definitions,
which for you makes sense to annotate.

-- 
Caml-list mailing list.  Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Reply via email to