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=1.4 required=5.0 tests=AWL,DNS_FROM_RFC_POST, SPF_NEUTRAL 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 EABDBBB84 for ; Wed, 28 Jan 2009 01:33:35 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AugBAMg2f0lIDtyZimdsb2JhbACTSj8BAQEKCQwHDwWmXoEFjlsBAwEDhUQG X-IronPort-AV: E=Sophos;i="4.37,335,1231110000"; d="scan'208";a="34361743" Received: from fg-out-1718.google.com ([72.14.220.153]) by mail4-smtp-sop.national.inria.fr with ESMTP; 28 Jan 2009 01:33:35 +0100 Received: by fg-out-1718.google.com with SMTP id d23so327951fga.25 for ; Tue, 27 Jan 2009 16:33:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:content-type:cc:subject:from :to:references:in-reply-to:date:message-id:user-agent; bh=Dy+EybPtOQAjvhQepd4zGq2P7z+AkJmdpx9K33xRbSk=; b=VLDL907ex4SIRYumukpPMLB6U7x3HWx0rWM82AIB3QFORZCL3L+Tp31vdjdb3lqW8+ v8JsMX80C/w9HF6eNZ669AWKhrKWp7EHLIj8kgXAIg5/tzxSaTHDQbI+oPboDZbRj85y xvayPBpblN9kLzOxP3vbv4leN5Mv+JrRN9XYs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=content-type:cc:subject:from:to:references:in-reply-to:date :message-id:user-agent; b=OUHtHpwVenqaR53DhgFC9zkl6aw5MQb4dIexLiCrKGbNtlFi+H1uKYdyTZom9wecVj GBO1i7wYBtrelOPClO/cjjmsEeQWkf89aO5KsBLpLRtEOdU7eCJnzBuba+WcvNOWaC00 p/vBrWxC+3tK+Wh1Iy845ZxxNWZSDfn9hSqcs= Received: by 10.86.98.18 with SMTP id v18mr348289fgb.49.1233102815155; Tue, 27 Jan 2009 16:33:35 -0800 (PST) Received: from localhost (home.feydakins.org [82.229.164.236]) by mx.google.com with ESMTPS id e11sm6194222fga.49.2009.01.27.16.33.34 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 27 Jan 2009 16:33:34 -0800 (PST) Content-Type: text/plain; charset=UTF-8 Cc: Jacques Carette , caml-list , Andrej Bauer Subject: Re: [Caml-list] Defining a family of functors From: Nicolas Pouillard To: David Teller References: <497DD1F5.7050702@yahoo.fr> <497DD398.5030501@mcmaster.ca> <7d8707de0901270630mf12c557oc0554a4276b62463@mail.gmail.com> <497F1E8D.2080000@mcmaster.ca> <1233090779.6463.10.camel@Blefuscu> In-Reply-To: <1233090779.6463.10.camel@Blefuscu> Date: Wed, 28 Jan 2009 01:32:30 +0100 Message-Id: <1233102370-sup-9649@ausone.local> User-Agent: Sup/git X-Spam: no; 0.00; functors:01 ocaml:01 existential:01 existential:01 modular:01 didier:01 syntax:01 compiler:01 2009:98 abstract:01 encode:01 caml-list:01 modules:02 modules:02 essentially:02 Excerpts from David Teller's message of Tue Jan 27 22:12:59 +0100 2009: > I'd like that, too. I may be wrong but I have the impression that most > of this can already be done with the current type system of OCaml. > > Unless I'm mistaken, for first-class modules, you essentially need > * extendable records (aka objects, good thing we already have them) > * existential types (which may be encoded with universal types, and > since we have universal types in classes, there may be a way to to this > already) The encoding of modules using existential types in non modular, this basically means that you have to heavily transform the source. What one need to encode modules is "open" existential types, this well and clearly explained in this POPL'09 paper: «Modeling Abstract Types in Modules with Open Existential Types», by Benoît Montagu and Didier Rémy > * namespace (which I'm sure could be encoded somehow). > > Now, the syntax would certainly be awful, but if I'm right it wouldn't > take too much to get these modules into the compiler. Kind regards, -- Nicolas Pouillard