Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: "Christoph Höger" <christoph.hoeger@tu-berlin.de>
To: caml users <caml-list@inria.fr>
Subject: [Caml-list] ppx_deriving_morphism 0.1
Date: Wed, 11 Nov 2015 14:36:34 +0100	[thread overview]
Message-ID: <56434462.3040109@tu-berlin.de> (raw)

ppx_deriving_morphism is a plugin for ppx_deriving that attempts to
automatically generate folder and mapper objects in the style of the
ast_mapper from the compiler libs.

This should help compiler-writers and anyone else dealing with
cumbersome recursive functions where most lines are only syntactic
noise (free variables, substitution). The goal is to have
implementations that are convenient to use and extend via the record
update syntax.

A mapper is an object that provides a map routine for each type in the
annotated group of type-definitions.

A ('a,'b) map_routine is a function mapper -> 'a -> 'b

A 'a folder is an object that provides ('a, t) fold_routine for each
type t in the annotated group of type-definitions.

A ('a,'b) fold_routine is a function folder -> 'b -> 'a -> 'a

For each variant-type in the group, a dispatcher and for each variant
a map/fold_routine is generated, so folding and mapping can be
selective for each variant.

Please feel encouraged to test and contribute. The plugin is largely
incomplete but I have only time and motivation to implement what fits
my needs or is useful for several other people. Any kind of feedback
is also appreciated.

https://github.com/choeger/ppx_deriving_morphism/

The package has just arrived on opam.

Christoph

-- 
Christoph Höger

Technische Universität Berlin
Fakultät IV - Elektrotechnik und Informatik
Übersetzerbau und Programmiersprachen

Sekr. TEL12-2, Ernst-Reuter-Platz 7, 10587 Berlin

Tel.: +49 (30) 314-24890
E-Mail: christoph.hoeger@tu-berlin.de

                 reply	other threads:[~2015-11-11 13:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=56434462.3040109@tu-berlin.de \
    --to=christoph.hoeger@tu-berlin.de \
    --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