From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id A03B6BBCA for ; Thu, 20 Mar 2008 21:10:45 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgIBAP9g4kfUGypAmmdsb2JhbACBWo8qAQEBAQEIBQkHFplr X-IronPort-AV: E=Sophos;i="4.25,533,1199660400"; d="asc'?vcf'?scan'208";a="24013225" Received: from smtp7-g19.free.fr ([212.27.42.64]) by mail4-smtp-sop.national.inria.fr with ESMTP; 20 Mar 2008 21:10:45 +0100 Received: from smtp7-g19.free.fr (localhost [127.0.0.1]) by smtp7-g19.free.fr (Postfix) with ESMTP id BEAB732286D; Thu, 20 Mar 2008 21:10:44 +0100 (CET) Received: from Tocksi.local (lns-bzn-48f-81-56-220-129.adsl.proxad.net [81.56.220.129]) by smtp7-g19.free.fr (Postfix) with ESMTP id 72B6B322832; Thu, 20 Mar 2008 21:10:44 +0100 (CET) Message-ID: <47E2C4BF.7050003@univ-savoie.fr> Date: Thu, 20 Mar 2008 21:10:39 +0100 From: Christophe Raffalli User-Agent: Thunderbird 2.0.0.12 (Macintosh/20080213) MIME-Version: 1.0 To: Martin Jambon Cc: Yaron Minsky , Caml Mailing List Subject: Re: [Caml-list] The Bridge Pattern in OCaml References: <4a051d930803190929q60d31012kb6c9d2b03a2d2ca6@mail.gmail.com> <0A1AD394-2F3B-488E-926B-1839C7C321E6@erratique.ch> <4a051d930803191044t1a1e9cb6h65ddbbda24cd7e1d@mail.gmail.com> <4a051d930803191106v74fa5de3j92530c3bf15ea9d5@mail.gmail.com> <891bd3390803191907q5838ee66u83cb35e549805af0@mail.gmail.com> In-Reply-To: X-Enigmail-Version: 0.95.6 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig9C50697BC07DADA2180BBAA8" X-Spam: no; 0.00; christophe:01 raffalli:01 christophe:01 raffalli:01 univ-savoie:01 ocaml:01 variants:01 variants:01 ocaml:01 modular:01 cheers:01 chablais:01 73376:01 univ-savoie:01 polymorphic:01 X-Attachments: cset="utf-8" name="Christophe_Raffalli.vcf" name="Christophe_Raffalli.vcf" type="application/pgp-signature" name="signature.asc" name="signature.asc" This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig9C50697BC07DADA2180BBAA8 Content-Type: multipart/mixed; boundary="------------040100000202070007020008" This is a multi-part message in MIME format. --------------040100000202070007020008 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable > I find the biggest advantage of objects over records to be the same as = > polymorphic variants over classic variants: No surprise, the duality between sum types (normal variant) and record=20 types (duality mean that they can encode one another through a functional encoding) can be lifted to objects for=20 records ans polymorphic variants for sum ... In Ocaml, the polymorphic variant sare a bit too limited to have the=20 full duality. To do it one would need the type system to know that in (match t with `A -> ... | x -> ...) x can=20 not use `A. Nervertheless, J. Garrigue modular evaluator is a bery nice illustration of this (look at his web page for the paper).= The problem is to have tuples, records, objects and modules to be only=20 one thing (and by the way require that variant always have exactly one=20 argument), so that you do not have to choose which approach you prefer ... Cheers, --=20 Christophe Raffalli Universite de Savoie Batiment Le Chablais, bureau 21 73376 Le Bourget-du-Lac Cedex tel: (33) 4 79 75 81 03 fax: (33) 4 79 75 87 42 mail: Christophe.Raffalli@univ-savoie.fr www: http://www.lama.univ-savoie.fr/~RAFFALLI --------------------------------------------- IMPORTANT: this mail is signed using PGP/MIME At least Enigmail/Mozilla, mutt or evolution=20 can check this signature. The public key is stored on www.keyserver.net --------------------------------------------- --------------040100000202070007020008 Content-Type: text/x-vcard; charset=utf-8; name="Christophe_Raffalli.vcf" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="Christophe_Raffalli.vcf" begin:vcard fn:Christophe Raffalli n:Raffalli;Christophe org:LAMA (UMR 5127) email;internet:christophe.raffalli@univ-savoie.fr title;quoted-printable:Ma=3DC3=3DAEtre de conf=3DC3=3DA9rences tel;work:+33 4 79 75 81 03 note:http://www.lama.univ-savoie.fr/~raffalli x-mozilla-html:TRUE version:2.1 end:vcard --------------040100000202070007020008-- --------------enig9C50697BC07DADA2180BBAA8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFH4sTEi9jr/RgYAS4RAuJoAJ9AFpNz/Yd+A72UknmsAE3/jnxC1ACeNvST oglFY1xzT8OFngwi12guTPM= =tKfz -----END PGP SIGNATURE----- --------------enig9C50697BC07DADA2180BBAA8--