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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id A7269BB84 for ; Tue, 27 Jan 2009 15:48:20 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjsFAAitfkmCcUBTgWdsb2JhbACUBQEBCwcECgcRtlOFTA X-IronPort-AV: E=Sophos;i="4.37,332,1231110000"; d="scan'208";a="23142024" Received: from sigma957.cis.mcmaster.ca ([130.113.64.83]) by mail1-smtp-roc.national.inria.fr with ESMTP; 27 Jan 2009 15:48:20 +0100 Received: from Gorash7.UTS.McMaster.CA (Gorash7.UTS.mcmaster.ca [130.113.196.61]) by sigma957.cis.mcmaster.ca (8.13.7/8.13.7) with ESMTP id n0REm8hG025216; Tue, 27 Jan 2009 09:48:16 -0500 (EST) Received: from cgpsrv2.cis.mcmaster.ca (univmail.CIS.McMaster.CA [130.113.64.46]) by Gorash7.UTS.McMaster.CA (8.13.7/8.13.7) with ESMTP id n0RElgYD013394; Tue, 27 Jan 2009 09:47:42 -0500 Received: from [129.97.169.240] (account carette@univmail.cis.mcmaster.ca [129.97.169.240] verified) by cgpsrv2.cis.mcmaster.ca (CommuniGate Pro SMTP 4.3.12) with ESMTPA id 240290326; Tue, 27 Jan 2009 09:47:42 -0500 Message-ID: <497F1E8D.2080000@mcmaster.ca> Date: Tue, 27 Jan 2009 09:47:41 -0500 From: Jacques Carette User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) MIME-Version: 1.0 To: Andrej Bauer Cc: caml-list@inria.fr Subject: Re: [Caml-list] Defining a family of functors References: <497DD1F5.7050702@yahoo.fr> <497DD398.5030501@mcmaster.ca> <7d8707de0901270630mf12c557oc0554a4276b62463@mail.gmail.com> In-Reply-To: <7d8707de0901270630mf12c557oc0554a4276b62463@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-PMX-Version-Mac: 5.4.2.338381, Antispam-Engine: 2.6.0.325393, Antispam-Data: 2009.1.27.143426 X-PerlMx-Spam: Gauge=IIIIIII, Probability=7%, Report='BODY_SIZE_1000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_800_899 0, __BOUNCE_CHALLENGE_SUBJ 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0, __USER_AGENT 0' X-Spam: no; 0.00; functors:01 andrej:01 camlp:01 notation:01 namespaces:01 higher-order:01 o'caml:01 variants:01 haskell:01 viz:98 viz:98 polymorphic:01 polymorphic:01 wrote:01 caml-list:01 Andrej Bauer wrote: > Because of problems like these I sometimes wish I had first-class > modules. I wonder how different that is from having first-class > polymorphic records, actually. Perhaps a bit of camlp4 to wrap up > records in module-like notation would do the trick. > If your modules do not define new types, then the main difference is that of name spaces (records pollute the global namespace, modules define local namespaces). However, I could not get far with modules that only define new values (functions). 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