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.0 required=5.0 tests=AWL,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 8979CBC69 for ; Thu, 18 Oct 2007 02:44:40 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAP1IFkfRVYC+kmdsb2JhbACOTQIBAQcCBhMW X-IronPort-AV: E=Sophos;i="4.21,291,1188770400"; d="scan'208";a="18158257" Received: from fk-out-0910.google.com ([209.85.128.190]) by mail4-smtp-sop.national.inria.fr with ESMTP; 18 Oct 2007 02:44:40 +0200 Received: by fk-out-0910.google.com with SMTP id b27so5764fka for ; Wed, 17 Oct 2007 17:44:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:received:date:to:subject:message-id:references:mime-version:content-type:content-disposition:in-reply-to:user-agent:from; bh=VQKkZc1rSPIgcjZlbE70Y+S7Z7pCdCaY/PCkHGYLwE4=; b=DyrO068eguWA8yYrt5335PK+7lU9ONSXQKmMmVtrSd9RenWYTDlogQBNw7PJhak2WZ8YwXf+HC+Rso90dgfkNk9Q8cJGMakKknaSOGjDjFLXq9NGL9xR8qEyn6QqoPU4tNrAWGzAEX3ZnJVpvjkr68xqE1N29IU/rBYkxMWGYOU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:date:to:subject:message-id:references:mime-version:content-type:content-disposition:in-reply-to:user-agent:from; b=ly7K+m8ybZPiDHNzkZB86024MqN9hKiHI6h8RQIbyq1FjJTs5zA4UHciEpVq+wyI4kb/xGyNgvSfGo4LEjii7HKsmZw9YgVz2nMqG1WcJdfOSDpNBL1Qe06L7ojNJQ2trrz/seCMt6eHEWqhpM3wJmq2iTxdkO0CFAE5uo4GlT0= Received: by 10.82.134.12 with SMTP id h12mr2847821bud.1192668278932; Wed, 17 Oct 2007 17:44:38 -0700 (PDT) Received: from localhost ( [86.211.129.64]) by mx.google.com with ESMTPS id f7sm947851nfh.2007.10.17.17.44.35 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 17 Oct 2007 17:44:37 -0700 (PDT) Received: by localhost (sSMTP sendmail emulation); Thu, 18 Oct 2007 02:45:06 +0200 Date: Thu, 18 Oct 2007 02:45:06 +0200 To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] How to expose sum type constructors to an interface Message-ID: <20071018004506.GA17963@localhost> References: <4716A5F2.9090708@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4716A5F2.9090708@web.de> User-Agent: Mutt/1.5.16 (2007-06-11) From: Julien Moutinho X-Spam: no; 0.00; constructors:01 0200,:01 constructors:01 mli:01 toplevel:01 ocamlc:01 val:01 pointers:01 oreilly-book:01 kwd:01 wrote:01 caml-list:01 functions:01 define:02 caml:02 On Thu, Oct 18, 2007 at 02:16:50AM +0200, Felix Dorner wrote: > In my implementation file module.ml I define: type aType = A | B > How I now need to expose this Type and its constructors to the interface > module.mli, because some of the functions declared in the interface take a > parameter of type "aType". How can I do this? The toplevel or the flag -i Print inferred interface may help you :) % cat file.ml type a_type = A | B let f = function | A -> B | _ -> A % ocamlc -i file.ml type a_type = A | B val f : a_type -> a_type A few pointers that may help too: http://caml.inria.fr/pub/docs/oreilly-book/html/book-ora130.html#toc180 http://caml.inria.fr/pub/docs/manual-ocaml/manual018.html#@manual.kwd135