From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 455EE7EEFA for ; Wed, 11 Nov 2015 14:36:37 +0100 (CET) IronPort-PHdr: 9a23:utn3gxxEpdHtTF/XCy+O+j09IxM/srCxBDY+r6Qd0ewUIJqq85mqBkHD//Il1AaPBtWGra4bwLeP+4nbGkU+or+5+EgYd5JNUxJXwe43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6anHS+4HYoFwnlMkItf6KuStOU05v8irn60qaQSjsLrQL1Wal1IhSyoFeZnegtqqwmFJwMzADUqGBDYeVcyDAgD1uSmxHh+pX4p8Y7oGwD884mosVJVKGyYr81V6cQWD8vNmRw4MzwqTHCSxGO7z0SSDNFvABPBl3u7Av7RYv2qivNlnRy1TPSacb2V7EvRTO67+FrTxLnhT0vKyN8+mzNjs12yq5W9kHy7ydjypLZNdnGfMF1ebnQKIsX Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=christoph.hoeger@tu-berlin.de; spf=None smtp.mailfrom=christoph.hoeger@tu-berlin.de; spf=None smtp.helo=postmaster@mail.tu-berlin.de Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of christoph.hoeger@tu-berlin.de) identity=pra; client-ip=130.149.7.33; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="christoph.hoeger@tu-berlin.de"; x-sender="christoph.hoeger@tu-berlin.de"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of christoph.hoeger@tu-berlin.de) identity=mailfrom; client-ip=130.149.7.33; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="christoph.hoeger@tu-berlin.de"; x-sender="christoph.hoeger@tu-berlin.de"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail.tu-berlin.de) identity=helo; client-ip=130.149.7.33; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="christoph.hoeger@tu-berlin.de"; x-sender="postmaster@mail.tu-berlin.de"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0C4AAAwQ0NWnCEHlYJehA5vwBIXCoc2PBABAQEBAQEBARABAQEBAQgLCQkhLoItgjEECwFFNgIFFgsCCwMCAQIBSw0GAgEBiCoECaNSj3CRCwSBAZIMDC4TgTEFlkiFHYlkhECCfoYThEWIVDiCUoFecYVWAQEB X-IPAS-Result: A0C4AAAwQ0NWnCEHlYJehA5vwBIXCoc2PBABAQEBAQEBARABAQEBAQgLCQkhLoItgjEECwFFNgIFFgsCCwMCAQIBSw0GAgEBiCoECaNSj3CRCwSBAZIMDC4TgTEFlkiFHYlkhECCfoYThEWIVDiCUoFecYVWAQEB X-IronPort-AV: E=Sophos;i="5.20,275,1444687200"; d="scan'208";a="187066982" Received: from mail.tu-berlin.de ([130.149.7.33]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Nov 2015 14:36:36 +0100 X-tubIT-Incoming-IP: 91.65.128.77 Received: from ip5b41804d.dynamic.kabel-deutschland.de ([91.65.128.77] helo=[192.168.178.42]) by mail.tu-berlin.de (exim-4.76/mailfrontend-7) with esmtpsa [UNKNOWN:AES128-SHA:128] for id 1ZwVZi-0007Kd-3B; Wed, 11 Nov 2015 14:36:36 +0100 To: caml users From: =?UTF-8?Q?Christoph_H=c3=b6ger?= X-Enigmail-Draft-Status: N1110 Organization: =?UTF-8?Q?Technische_Universit=c3=a4t_Berlin?= Message-ID: <56434462.3040109@tu-berlin.de> Date: Wed, 11 Nov 2015 14:36:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2015.11.11.132715 X-PMX-Spam: Gauge=IIIIIII, Probability=0%, Report='' Subject: [Caml-list] ppx_deriving_morphism 0.1 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