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 RAA05961; Thu, 3 Apr 2003 17:09:20 +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 RAA05906 for ; Thu, 3 Apr 2003 17:09:19 +0200 (MET DST) Received: from ux9.sp.cs.cmu.edu (UX9.SP.CS.CMU.EDU [128.2.220.166]) by nez-perce.inria.fr (8.11.1/8.11.1) with SMTP id h33F9I902401 for ; Thu, 3 Apr 2003 17:09:18 +0200 (MET DST) Received: from 12-227-106-227.client.attbi.com ([12.227.106.227]) by ux9.sp.cs.cmu.edu id aa26465; 3 Apr 2003 10:08 EST Received: from ecc by stratocaster.home with local (Exim 3.36 #1 (Debian)) id 1916Kf-0000VC-00 for ; Thu, 03 Apr 2003 10:08:49 -0500 Date: Thu, 3 Apr 2003 10:08:49 -0500 To: caml-list@inria.fr Subject: Re: [Caml-list] mystified by typing of optional arguments Message-ID: <20030403150849.GA1919@ecooper.com> Mail-Followup-To: caml-list@inria.fr References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.3i From: "Eric C. Cooper" X-Spam: no; 0.00; caml-list:01 typable:01 0200,:01 simpler:01 match:02 typing:03 wrote:03 arguments:03 let:04 cooper:06 eric:06 thu:08 function:09 opt:09 03,:11 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Thu, Apr 03, 2003 at 04:50:44PM +0200, Francois Rouaix wrote: > The following example mystifies me > > let f ?opt x = > match opt with > | None -> x > | Some dx -> x + dx > > let g x = x + 1 > > let h1 = function > | 0 -> [g] > | _ -> [f; g] > > > let h2 = function > | _ -> [f; g] > > > h1 is typable but not h2. > Why is that ? Even simpler: [g; f] type-checks, but [f; g] does not. -- Eric C. Cooper e c c @ c m u . e d u ------------------- 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