From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p7E6Kqg1022442 for ; Sun, 14 Aug 2011 08:20:52 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiICAOZoR07UGyoFkWdsb2JhbABBmHCPCBQBAQEBCQsLBxQDIoFAAQEFJxNPC0YUiE6zEIVoXwSYLItd X-IronPort-AV: E=Sophos;i="4.67,369,1309730400"; d="scan'208";a="105423880" Received: from smtp5-g21.free.fr ([212.27.42.5]) by mail4-smtp-sop.national.inria.fr with ESMTP; 14 Aug 2011 08:20:44 +0200 Received: from yeeloong (unknown [82.67.194.89]) by smtp5-g21.free.fr (Postfix) with SMTP id 7C10AD48054 for ; Sun, 14 Aug 2011 08:20:37 +0200 (CEST) Received: by yeeloong (sSMTP sendmail emulation); Sun, 14 Aug 2011 08:19:59 +0200 Date: Sun, 14 Aug 2011 08:19:59 +0200 From: rixed@happyleptic.org To: caml-list@inria.fr Message-ID: <20110814061959.GC32098@yeeloong.happyleptic.org> References: <20110806125021.GB10154@ombreroze.happyleptic.org> <4E3D3A89.90007@inria.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4E3D3A89.90007@inria.fr> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [Caml-list] typer strangeness (3.12.0) Thank you for your answers, but you aimed too high above my understanding :-) -[ Sat, Aug 06, 2011 at 02:58:49PM +0200, Fabrice Le Fessant ]---- > The type constraint that you specified does not constraint the > polymorphism of the type. To declare a polymorphic constraint, you must > use (with OCaml >= 3.12.0) : > > let pipe : 'a 'b 'c. ('a, 'b) parzer -> ('c, 'a) parzer -> ('c, 'b) parzer = Never saw this notation before. I checked in the manual but beside in the language grammar (in the definition of a poly-typexpr) I could find more explanation. Is it explained somewhere why this notation was required and why this: let pipe : ('a, 'b) parzer -> ('c, 'a) parzer -> ('c, 'b) parzer = is not enough? What's adding the "'a 'b 'c. " exactly ? I understand that it forbids ocaml to consider that the various 'a (for instance) may be differents 'a, but I don't understand why ocaml migh do that in the first place (especially to produce a _less general_ type than the one given) ? If it's not a bug, then what's the purpose ? As for my second question, I received no answer (was: why changing the pattern match for something that should be equivalent changes the infered type). If you suspect this can be a bug then I can look for a simple reproductible case.