From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 5D162BC57 for ; Thu, 16 Dec 2010 09:32:21 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjABAI1dCU1SgmMamWdsb2JhbACWBo4uFQEBAgEICwoHESTBBoVKBIp7gxw X-IronPort-AV: E=Sophos;i="4.59,354,1288566000"; d="asc'?scan'208";a="82864723" Received: from edge20.ethz.ch ([82.130.99.26]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-SHA; 16 Dec 2010 09:32:21 +0100 Received: from CAS20.d.ethz.ch (172.31.51.110) by edge20.ethz.ch (82.130.99.26) with Microsoft SMTP Server (TLS) id 14.1.218.12; Thu, 16 Dec 2010 09:32:11 +0100 Received: from localhost (194.230.155.13) by CAS20.d.ethz.ch (172.31.51.110) with Microsoft SMTP Server (TLS) id 14.1.218.12; Thu, 16 Dec 2010 09:32:19 +0100 Date: Thu, 16 Dec 2010 09:32:17 +0100 From: Alexander Bernauer To: Subject: Re: [Caml-list] type of high order functions Message-ID: <20101216083217.GC29535@apus.ethz.ch> References: <20101214203043.GA9093@apus.ethz.ch> <4D087CDF.7000004@imag.fr> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="QRj9sO5tAVLaXnSD" Content-Disposition: inline In-Reply-To: <4D087CDF.7000004@imag.fr> User-Agent: Mutt/1.5.20 (2009-06-14) X-Originating-IP: [194.230.155.13] X-Spam: no; 0.00; 0100,:01 inference:01 wrote:01 compile:01 typing:01 caml-list:01 functions:01 algorithm:01 inferred:02 restrict:02 constraints:03 alexander:03 alex:03 hmm:04 dec:05 X-Attachments: type="application/pgp-signature" name="signature.asc" --QRj9sO5tAVLaXnSD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Dec 15, 2010 at 09:31:27AM +0100, Florent Ouchet wrote: > >Why is it that the first example does not compile while the later ones do? > Because type constraints are considered: > - only for type restriction, not for generalization; Hmm, I thought specifying a type is always a restriction compared to saying nothing at all and thus allowing everything. > - after the type inference algorithm is executed. If I don't specify a type, what's the inferred type of f? If I restrict f to the exact same type it should do no harm. At least, that is what I expected. So, I do understand your explanations but I don't understand the reasons for them. I will go and consult the literature on the ML typing system. Thank you all for your replies. Greetings Alex --QRj9sO5tAVLaXnSD Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAk0JzpEACgkQZ3o+CqNf/NfAlwCgrlBVWJaWonKr36YiI/ZzqX6F 8qsAn0P4FlCM2OwbI6O69dYFvS5gVBak =Dzw4 -----END PGP SIGNATURE----- --QRj9sO5tAVLaXnSD--