From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id A5073BBBB for ; Mon, 27 Feb 2006 16:07:20 +0100 (CET) Received: from ext.lri.fr (ext.lri.fr [129.175.15.4]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k1RF7Ksm011239 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 27 Feb 2006 16:07:20 +0100 Received: from smtp.lri.fr (serveur3-5 [129.175.3.5]) by ext.lri.fr (Postfix) with ESMTP id 2673F2024B0; Mon, 27 Feb 2006 16:07:20 +0100 (CET) Received: from pc9-152 (pc9-152 [129.175.9.152]) by smtp.lri.fr (Postfix) with ESMTP id 2E4B7CED98; Mon, 27 Feb 2006 16:07:18 +0100 (CET) Received: from filliatr by pc9-152 with local (Exim 3.36 #1 (Debian)) id 1FDjxa-0005PG-00; Mon, 27 Feb 2006 16:06:50 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <17411.5509.49103.254957@gargle.gargle.HOWL> Date: Mon, 27 Feb 2006 16:06:45 +0100 To: "Merijn de Jonge" Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Writing Identity Functors (or Wrapper modules) in OCAML In-Reply-To: References: X-Mailer: VM 7.19 under Emacs 21.4.1 From: Jean-Christophe Filliatre X-Virus-Scanned: by amavisd-new at lri.fr X-Miltered: at nez-perce with ID 440315A8.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 functors:01 ocaml:01 filliatre:01 filliatr:01 lri:01 functor:01 ocaml:01 struct:01 filliatre:01 lri:01 filliatr:01 writes:01 modules:01 equation:02 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 Merijn de Jonge writes: > > I've problems in writing an Identity Functor in OCAML that I want to use as > a wrapper module. A type representation is missing: you should write your wrapper as ====================================================================== module Wrapper (X: IHelloWorld) : IHelloWorld = struct type helloWorldType = X.helloWorldType = Hello | World let hello = X.hello end ====================================================================== See the paragraph "Re-exported variant type or record type: an equation, a representation." in section 6.8.1 of the Ocaml manual (http://caml.inria.fr/pub/docs/manual-ocaml/manual016.html) Hope this helps, -- Jean-Christophe Filliātre (http://www.lri.fr/~filliatr)