From: "Matej Košík" <5764c029b688c1c0d24a2e97cd764f@gmail.com>
To: Yaron Minsky <yminsky@janestreet.com>
Cc: Caml List <caml-list@inria.fr>
Subject: Re: [Caml-list] concerning using of `deriving' syntactic plugin
Date: Wed, 07 Mar 2012 16:44:04 +0000 [thread overview]
Message-ID: <4F579054.60203@gmail.com> (raw)
In-Reply-To: <CACLX4jRpM=FmeCF9Q9ZB+o-hTTbKaR2R2fAU2HtFjPjFyqf3pw@mail.gmail.com>
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.
next prev parent reply other threads:[~2012-03-07 16:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-07 11:49 Matej Košík
2012-03-07 12:31 ` Gabriel Scherer
2012-03-07 16:44 ` Matej Košík
2012-03-07 17:06 ` Jérémie Dimino
2012-03-07 12:34 ` Yaron Minsky
2012-03-07 16:44 ` Matej Košík [this message]
2012-03-07 17:10 ` Markus Mottl
2012-03-07 17:28 ` Matej Košík
2012-03-07 20:47 ` Till Varoquaux
2012-03-08 2:49 ` Markus Mottl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F579054.60203@gmail.com \
--to=5764c029b688c1c0d24a2e97cd764f@gmail.com \
--cc=caml-list@inria.fr \
--cc=yminsky@janestreet.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox