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.0 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 29248BC69 for ; Fri, 5 Oct 2007 12:30:38 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAAavBUfAXQImh2dsb2JhbACOOQIBCAop X-IronPort-AV: E=Sophos;i="4.21,234,1188770400"; d="scan'208";a="2178756" Received: from discorde.inria.fr ([192.93.2.38]) by mail1-smtp-roc.national.inria.fr with ESMTP; 05 Oct 2007 12:30:38 +0200 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l95AUbYt026974 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Fri, 5 Oct 2007 12:30:37 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAFKuBUdA6ba9i2dsb2JhbACOOQIBCAQEExEF X-IronPort-AV: E=Sophos;i="4.21,234,1188770400"; d="scan'208";a="2413932" Received: from nf-out-0910.google.com ([64.233.182.189]) by mail2-smtp-roc.national.inria.fr with ESMTP; 05 Oct 2007 12:30:37 +0200 Received: by nf-out-0910.google.com with SMTP id g13so442591nfb for ; Fri, 05 Oct 2007 03:30:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:subject:from:to:cc:in-reply-to:references:content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding:sender; bh=G2xZmBPiosRb02qTlXtM4IgkvVu7Xl0T9DePxWhMWmk=; b=bb95ghM99pXdBxmxnuigEgZZpHMFSfe7UolLl2hcjfGnve64cG1CBccK1CoaQxvSgdxp+W1velcQ6mNoQleUW5r6a6z14nEtm2FOaqbVtJdC07dLUr2C9T0mV5Atr2cEXblsh0Nibvlr38dMXe3jgnHA6y6XvcbhmskBVuWbMqk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:subject:from:to:cc:in-reply-to:references:content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding:sender; b=H7Jf5N+Pv6pdz7RboL71AinXiy9xbAFDgtYbzLmy6yKv9HqMB7JFiLlybKnW2au6ExSC5E8afhXSEqtpBWme45DaoAlrWs48eWpc6MPNwPwrBd9yMKEmS2MVFWYBEmIvB2DfwDAiuL6tcKuuWVuj+NTXlSzaIDW5QrQQbF0H4W0= Received: by 10.86.28.5 with SMTP id b5mr2342962fgb.1191580236680; Fri, 05 Oct 2007 03:30:36 -0700 (PDT) Received: from ?192.168.0.12? ( [82.235.58.110]) by mx.google.com with ESMTPS id f31sm5233322fkf.2007.10.05.03.30.34 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 05 Oct 2007 03:30:35 -0700 (PDT) Subject: Re: [Caml-list] Why can't I call a function over a subclass? From: David Teller To: Florian Hars Cc: Luca de Alfaro , Inria Ocaml Mailing List In-Reply-To: <4705EF58.3040605@bik-gmbh.de> References: <28fa90930710050048p3d6f4e8cs8e13d0fe49d296f2@mail.gmail.com> <4705EF58.3040605@bik-gmbh.de> Content-Type: text/plain Date: Fri, 05 Oct 2007 12:30:33 +0200 Message-Id: <1191580233.6509.26.camel@Blefuscu> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: 7bit Sender: David Teller X-Miltered: at discorde with ID 4706124D.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ens-lyon:01 cheers:01 0200,:01 hars:01 typechecker:01 enforces:01 subtypes:01 beginner's:01 ocaml:01 bug:01 beginners:01 wrote:01 caml-list:01 caml-list:01 bin:01 I agree with Luca that it's disconcerting. When r is a class, I would expect let f (x:r) (y:r) =... to have a type such as x :> r -> y :> r -> ... Cheers, David On Fri, 2007-10-05 at 10:01 +0200, Florian Hars wrote: > Luca de Alfaro schrieb: > > The absurdity continues: > > This is not absurd, this is the documented correct behaviuor. > If *you* decide that f must only accept arguments of *exactly* > type r, the typechecker enforces your decision, as it does if > you decide that f may also accept subtypes of r (as long as your > decisions are consistent within he type system). > > Yours, Florian. > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs