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 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id E617CBB84 for ; Tue, 27 Jan 2009 22:12:52 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqwCADUHf0nZRrJLgGdsb2JhbACUBwEBCwsKBRMFtmWFTA X-IronPort-AV: E=Sophos;i="4.37,334,1231110000"; d="scan'208";a="20250748" Received: from relay1-v.mail.gandi.net ([217.70.178.75]) by mail2-smtp-roc.national.inria.fr with ESMTP; 27 Jan 2009 22:12:52 +0100 Received: from [192.168.0.1] (lau18-1-82-246-197-195.fbx.proxad.net [82.246.197.195]) by relay1-v.mail.gandi.net (Postfix) with ESMTP id 1A1C3362BF; Tue, 27 Jan 2009 22:12:52 +0100 (CET) Subject: Re: [Caml-list] Defining a family of functors From: David Teller Reply-To: David.Teller@mlstate.com To: Jacques Carette Cc: Andrej Bauer , caml-list@inria.fr In-Reply-To: <497F1E8D.2080000@mcmaster.ca> References: <497DD1F5.7050702@yahoo.fr> <497DD398.5030501@mcmaster.ca> <7d8707de0901270630mf12c557oc0554a4276b62463@mail.gmail.com> <497F1E8D.2080000@mcmaster.ca> Content-Type: text/plain Organization: MLState Date: Tue, 27 Jan 2009 22:12:59 +0100 Message-Id: <1233090779.6463.10.camel@Blefuscu> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; functors:01 ocaml:01 existential:01 syntax:01 compiler:01 cheers:01 higher-order:01 o'caml:01 variants:01 haskell:01 2009:98 viz:98 viz:98 polymorphic:01 wrote:01 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) * 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. Cheers, David On Tue, 2009-01-27 at 09:47 -0500, Jacques Carette wrote: > Bottom line: I too very much wish for first-class, higher-order > modules. As O'Caml already has open and closed products (viz rows and > records), open and closed sums (viz polymorphic and 'normal' variants), > the resulting system could steal back the 'elegant' monicker that has > drifted towards Haskell. > > Jacques