From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 2C7F6BC0A for ; Mon, 26 Feb 2007 20:02:10 +0100 (CET) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.184]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l1QJ29cE029337 for ; Mon, 26 Feb 2007 20:02:09 +0100 Received: by nf-out-0910.google.com with SMTP id m19so1477330nfc for ; Mon, 26 Feb 2007 11:02:09 -0800 (PST) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=BLSsI94YjUq5RGrqn/VkXlfOixXBIeds4E44jFsxCqZK6ngDbA9CWFNo3wkfs9ajT+12RCcNdHzpAdi3NoUrsxvuc1HPkBaQZSNZWsXwsdD4jFP6F3aDhbSIlRivnfkh7FwxDfxDyTEcudSZ62g71pJsS3NAdw8GJwVOj7ozmlY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=q4EYqrvF6zJ/a4XVikCVNQ20LJ+iztNDHOZF9yupDLsru3mgP6sEeSjp4a2zSuuB12J3oTJBV6RN0GUrTfWAps1JT5hICxbVK/volG5LpxmL0obF20BjAGZmu/BfKbOdsXw+JLU6IRprHQHwBzaO8JfY9dHC4BgClO0HUNJc4V0= Received: by 10.82.167.5 with SMTP id p5mr885277bue.1172516528872; Mon, 26 Feb 2007 11:02:08 -0800 (PST) Received: by 10.82.134.14 with HTTP; Mon, 26 Feb 2007 11:02:08 -0800 (PST) Message-ID: <4a708d20702261102x38ac9fd6v5cdefa9c436de9eb@mail.gmail.com> Date: Mon, 26 Feb 2007 20:02:08 +0100 From: "Lukasz Stafiniak" To: ocaml_beginners@yahoogroups.com, "caml users" Subject: Re: "ocaml_beginners"::[] Syntax for polymorphic methods In-Reply-To: <301730110702260959i561902dar1a26dceb5a11fd2c@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <301730110702251711h258dd326nb8a38f6751c4c8ea@mail.gmail.com> <4a708d20702260334i47bbde3fgcdf2ca2c296338c8@mail.gmail.com> <301730110702260959i561902dar1a26dceb5a11fd2c@mail.gmail.com> X-j-chkmail-Score: MSGID : 45E32EB1.000 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 45E32EB1.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; lukasz:01 ocaml:01 syntax:01 implicitly:01 quantified:01 val:01 bool:01 parmatch:01 exited:01 pty:98 pty:98 polymorphic:01 polymorphic:01 beginners:01 wrote:01 On 2/26/07, Geoffrey Romer wrote: > > So what's the difference between 'a. and just plain ? Aren't > type variables implicitly universally quantified (i.e. isn't the whole point > of a polymorphic type that it applies for any possible 'a)? > You've got me here... Objective Caml version 3.09.3 # type pty = {pv : 'a . 'a list};; type pty = { pv : 'a. 'a list; } # let px = {pv = []};; val px : pty = {pv = []} # match px with {pv=[]} -> "OK" | {pv=5::_} -> "int" | {pv=true::_} -> "bool";; Fatal error: exception Assert_failure("typing/parmatch.ml", 784, 55) Process caml-toplevel exited abnormally with code 2