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=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 63B41BC6C for ; Sat, 25 Aug 2007 01:32:48 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l7ONWjL7006015 for ; Sat, 25 Aug 2007 01:32:47 +0200 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 24 Aug 2007 16:32:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.19,305,1183359600"; d="scan'208";a="267746666" Received: from orsmsx334.jf.intel.com ([10.22.226.45]) by azsmga001.ch.intel.com with ESMTP; 24 Aug 2007 16:32:44 -0700 Received: from orsmsx419.amr.corp.intel.com ([10.22.226.88]) by orsmsx334.jf.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 24 Aug 2007 16:32:43 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [Caml-list] Question on polymorphic typing for curried functions Date: Fri, 24 Aug 2007 16:32:42 -0700 Message-ID: <509223F0BF55E74FA1247D17207E7A0C01CE4E65@orsmsx419.amr.corp.intel.com> In-Reply-To: <46CF34DE.301@cs.umn.edu> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [Caml-list] Question on polymorphic typing for curried functions Thread-Index: Acfmh9ynVlNdFAANRDear/S8kp9jGgAHfO8g References: <46CF34DE.301@cs.umn.edu> From: "Harrison, John R" To: "Christopher Kauffman" Cc: "OCaml" X-OriginalArrivalTime: 24 Aug 2007 23:32:43.0852 (UTC) FILETIME=[11F4A0C0:01C7E6A7] X-Miltered: at discorde with ID 46CF6A9D.002 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; curried:01 curried:01 polymorphism:01 ocaml:01 polymorphism:01 polymorphic:01 polymorphic:01 typing:01 caml-list:01 functions:01 functions:01 imperative:01 variant:02 garrigue:03 garrigue:03 Hi Chris, | I am looking for a bit of information on the behavior of | curried functions wrt polymorphic arguments. For instance, in | the following example, using a curried function seems to lose | the nice polymorphism that I desire. OCaml uses a variant of the so-called "value restriction" to ensure soundness in the way polymorphism and imperative features interact. You can find more information in this paper by Jacques Garrigue: http://www.math.nagoya-u.ac.jp/~garrigue/papers/morepoly-long.pdf It can sometimes be annoying and unintuitive (for me anyway) to lose polymorphism by eta contraction. But this approach is at least relatively simple and well-understood. John.