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 LAA10268; Sun, 14 Sep 2003 11:28:55 +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 LAA04736 for ; Sun, 14 Sep 2003 11:28:54 +0200 (MET DST) Received: from mwinf0303.wanadoo.fr (smtp6.wanadoo.fr [193.252.22.28]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h8E9Srf12020 for ; Sun, 14 Sep 2003 11:28:54 +0200 (MET DST) Received: from debian (ca-bordeaux-8-27.w80-8.abo.wanadoo.fr [80.8.80.27]) by mwinf0303.wanadoo.fr (SMTP Server) with ESMTP id C4819500097D for ; Sun, 14 Sep 2003 11:28:53 +0200 (CEST) Received: from moi by debian with local (Exim 3.36 #1 (Debian)) id 19yTBo-0006Jy-00 for ; Sun, 14 Sep 2003 11:29:04 +0200 To: caml-list@inria.fr Subject: Re: [Caml-list] inference engine References: <1063436331.12717.11.camel@pelican> <20030913120100.281d9363.David.Baelde@ens-lyon.fr> <1063512749.23073.28.camel@pelican> From: Remi Vanicat Mail-Copy-To: never Date: Sun, 14 Sep 2003 11:29:04 +0200 In-Reply-To: <1063512749.23073.28.camel@pelican> (skaller@ozemail.com.au's message of "14 Sep 2003 14:12:30 +1000") Message-ID: <87n0d7pvkv.dlv@wanadoo.fr> User-Agent: Gnus/5.090024 (Oort Gnus v0.24) Emacs/21.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8bit X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 inference:01 ozemail:01 int':01 inference:01 ocaml:01 int:01 int:01 labri:01 u-bordeaux:01 writes:01 remi:01 remi:01 vanicat:01 vanicat:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk skaller writes: [...] > To do that I'm suggesting to give x the type 'at least an int', > meaning any subsequent typing of x in the function body > must be constrainable to int -- and that is checked every time > additional information is obtained by the inference engine > to refine the type. > > For another example: > > let f (x:int) = match x with | (a,b) -> .. > > should give an error saying: > > let f (x:int) = match x with | (a,b) -> .. > -------------------------------***** > > "Here x is used with type 'a * 'b, > which is not compatible with the constraint int" the error given by ocaml is : # let f (x:int) = match x with | (a,b) -> 2;; ^^^^^ This pattern matches values of type 'a * 'b but is here used to match values of type int -- Rémi Vanicat remi.vanicat@laposte.net ------------------- 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