caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Peter Zotov <whitequark@whitequark.org>
To: caml-list@inria.fr
Subject: [Caml-list] [ANN] ppx_deriving 0.1
Date: Wed, 23 Jul 2014 13:55:03 +0400	[thread overview]
Message-ID: <0618b5ce9c054e91507c03eae7e7de0c@whitequark.org> (raw)

Hello,

I'm glad to announce an initial release of ppx_deriving,
a modular syntax extension for type-driven code generation.
It will be shortly available in OPAM.

I will introduce ppx_deriving with an example:

# #require "ppx_deriving";;
# type file = {
   kind : [ `File | `Dir ];
   name : string;
   perm : int [@printer fun fmt -> Format.fprintf fmt "0o%03o"];
} [@@deriving Show, Eq];;
type file = { kind : [ `Dir | `File ]; name : bytes; perm : int; }
val pp_file : Format.formatter -> file -> unit = <fun>
val show_file : file -> bytes = <fun>
val equal_file : file -> file -> bool = <fun>
# print_endline (show_file { kind = `Dir; name = "bin"; perm = 0o755 
});;
{ kind = `Dir; name = "bin"; perm = 0o755 }
- : unit = ()

A more thorough description is available in README[1].

While I intend this release to primarily serve as a preview for
the community and a means to gather feedback, it is fully usable
and documented. Some of the planned features (marked "TBD" in README)
are not yet implemented.

I hope that ppx_deriving can serve as a future replacement to both
ocsigen's deriving and JaneStreet's type_conv. If you are responsible
for these libraries, please get in touch. The OCaml ecosystem would
benefit from a single type-driven code generation mechanism.

I welcome any comments.

   [1]: https://github.com/whitequark/ppx_deriving/

-- 
Peter Zotov
sip:whitequark@sipnet.ru

             reply	other threads:[~2014-07-23  9:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-23  9:55 Peter Zotov [this message]
2014-07-23 14:36 ` Yotam Barnoy
2014-07-23 20:19   ` Peter Zotov
2014-07-23 20:37     ` Yotam Barnoy
2014-07-28 12:26       ` Peter Zotov

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=0618b5ce9c054e91507c03eae7e7de0c@whitequark.org \
    --to=whitequark@whitequark.org \
    --cc=caml-list@inria.fr \
    /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;
as well as URLs for NNTP newsgroup(s).