caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] ppx_deriving_morphism 0.1
@ 2015-11-11 13:36 Christoph Höger
  0 siblings, 0 replies; only message in thread
From: Christoph Höger @ 2015-11-11 13:36 UTC (permalink / raw)
  To: caml users

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-11-11 13:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-11 13:36 [Caml-list] ppx_deriving_morphism 0.1 Christoph Höger

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).