From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id OAA24326; Tue, 10 Apr 2001 14:10:47 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id OAA24322 for ; Tue, 10 Apr 2001 14:10:47 +0200 (MET DST) Received: from iona.dcs.gla.ac.uk (iona.dcs.gla.ac.uk [130.209.240.35]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f3ACAkn06336; Tue, 10 Apr 2001 14:10:46 +0200 (MET DST) Received: from crab.dcs.gla.ac.uk ([130.209.241.150]) by iona.dcs.gla.ac.uk with esmtp (Exim 3.13 #1) id 14mwyr-0004Ux-00; Tue, 10 Apr 2001 13:10:45 +0100 Received: by crab.dcs.gla.ac.uk (8.8.8+Sun/Dumb) id NAA11307; Tue, 10 Apr 2001 13:10:45 +0100 (BST) From: reig@dcs.gla.ac.uk Message-Id: <200104101210.NAA11307@crab.dcs.gla.ac.uk> Subject: Re: [Caml-list] variant with tuple arg in pattern match? To: caml-list@inria.fr Date: Tue, 10 Apr 2001 13:10:44 +0100 (BST) Cc: Michel.Mauny@inria.fr In-Reply-To: <200104101147.MAA11108@crab.dcs.gla.ac.uk> from "reig@dcs.gla.ac.uk" at Apr 10, 2001 12:47:37 PM X-Mailer: ELM [version 2.5 PL3] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > Michel Mauny wrote: > > > Sure. With CamlP4's revised syntax, you would write this as > > > > type t 'a =3D > > I of int > > | B of bool > > | N of (t 'a) and (t 'a) (* parens probably unnecessary *) > > | Uncurried of int * int > > > Like in haskell, if it *looks* curried, it *is* curried. > > data T a = Curried (T a) (T a) > | Function (T a -> T a) > In fact, the syntax for the type definition could be like in haskell: use juxtaposition. type 'a t = Curried : ('a t) ('a t) | Function : 'a t -> 'a t After all, we already use juxtaposition for curried function definitions: let f x y = ... fun x y -> ... Fermin Reig ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr