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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id EC4C07FA5F for ; Mon, 30 Jan 2017 17:18:42 +0100 (CET) X-IronPort-AV: E=Sophos;i="5.33,312,1477954800"; d="scan'208";a="211413680" Received: from unknown (HELO MP-41019.local) ([128.93.83.34]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 30 Jan 2017 17:18:38 +0100 To: caml-list@inria.fr References: <588B89B9.8000502@inria.fr> <588F6415.4000900@inria.fr> From: =?UTF-8?Q?Fran=c3=a7ois_Pottier?= Message-ID: <588F675D.40502@inria.fr> Date: Mon, 30 Jan 2017 17:18:37 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <588F6415.4000900@inria.fr> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Caml-list] [ANN] visitors Le 30/01/2017 17:04, François Pottier a écrit : > If the two data types are unrelated, then, in order to translate the type > "foo" to the type "bar", you need a "fold" visitor for the type "foo". You > then have to manually implement each of the "build_" methods, so as to > explain how each data constructor of the type "foo" should be translated. I forgot to add that the manual has an example of converting between two entirely unrelated types: a user-defined type "crowd" is converted to "(string * string) list". -- François Pottier francois.pottier@inria.fr http://gallium.inria.fr/~fpottier/