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=AWL autolearn=disabled version=3.1.3 Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id E2B95BC6B for ; Fri, 24 Aug 2007 12:14:38 +0200 (CEST) Received: from bdmail1.accesst.com (pop.bulldoghome.com [83.245.1.230]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l7OAEc2b004273 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Fri, 24 Aug 2007 12:14:38 +0200 Received: from host-84-9-232-152.bulldogdsl.com ([84.9.232.152] helo=[192.168.123.191]) by bdmail1.accesst.com with esmtpa (Exim 4.50) id 1IOW4N-0005Fq-PK; Fri, 24 Aug 2007 11:07:12 +0100 Message-ID: <46CEAF76.20006@ed.ac.uk> Date: Fri, 24 Aug 2007 11:14:14 +0100 From: Jeremy Yallop User-Agent: Mozilla-Thunderbird 2.0.0.4 (X11/20070622) MIME-Version: 1.0 To: skaller Cc: caml-list@inria.fr Subject: Re: [Caml-list] pm variant type question References: <1187931704.7202.9.camel@rosella.wigram> In-Reply-To: <1187931704.7202.9.camel@rosella.wigram> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 46CEAF8E.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; regexp:01 regexp:01 seq:01 seq:01 wrote:01 caml-list:01 closure:01 closure:01 variant:02 parameter:02 string:02 string:02 epsilon:04 epsilon:04 null:05 skaller wrote: > type 'a regexp_t' = > [ > | `REGEXP_seq of 'a regexp_t' * 'a regexp_t' (** concatenation *) > | `REGEXP_alt of 'a regexp_t' * 'a regexp_t' (** alternation *) > | `REGEXP_aster of 'a regexp_t' (** Kleene closure *) > | `REGEXP_string of string (** concatenation of chars of string *) > | `REGEXP_epsilon (** epsilon: null string *) > ] If I understand rightly, then this should be type 'a regexp_t' = [ | `REGEXP_seq of 'a * 'a (** concatenation *) | `REGEXP_alt of 'a * 'a (** alternation *) | `REGEXP_aster of 'a (** Kleene closure *) | `REGEXP_string of string (** concatenation of chars of string *) | `REGEXP_epsilon (** epsilon: null string *) ] The version you gave will result in an xreg_t type that doesn't allow things like `REGEXP_alt (`REGEXP_code x, `REGEXP_code x) (In fact, in your version, the 'a parameter is never actually used.) Jeremy.