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 HAA25719; Mon, 11 Aug 2003 07:16:14 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id HAA24331 for ; Mon, 11 Aug 2003 07:16:13 +0200 (MET DST) Received: from remt26.cluster1.charter.net (remt26.cluster1.charter.net [209.225.8.36]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h7B5GCf19503 for ; Mon, 11 Aug 2003 07:16:12 +0200 (MET DST) Received: from [68.185.42.53] (HELO 1969.ws) by remt26.cluster1.charter.net (CommuniGate Pro SMTP 4.0.6) with ESMTP id 115412902; Mon, 11 Aug 2003 01:16:11 -0400 Message-ID: <3F37271A.60005@1969.ws> Date: Sun, 10 Aug 2003 22:18:18 -0700 From: Karl Zilles Organization: 1969 Communications, Inc. User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030529 X-Accept-Language: en-us, en MIME-Version: 1.0 To: skaller@ozemail.com.au CC: Oleg Trott , caml-list@inria.fr Subject: Re: [Caml-list] tpyping question References: <1060564412.7474.11.camel@localhost.localdomain> <200308102251.57305.oleg_trott@columbia.edu> <1060576786.9476.31.camel@localhost.localdomain> In-Reply-To: <1060576786.9476.31.camel@localhost.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 int:01 match:02 wrote:03 btw:03 let:04 type:07 i've:09 something:09 write:14 code:15 case:16 needed:17 skaller:20 handling:22 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk skaller wrote: > BTW: something I've needed is like this: > > type [`A of int * int | `B of int] > let f x = match x with > | `A (i,j) > | `B i with j=0 -> .... > (* ******** *) > > At the moment, I have to code this as: > > let f x = > let g i j = ... in > match x with > | `A (i,j) -> g i j > | `B i -> g i 0 > > delocalising the case handling code. > Wouldn't it be more natural to write: let f x = let (i,j) = match x with | `A v -> v | `B u -> (u,0) in ... ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners