From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 6F862BB9C for ; Fri, 9 Dec 2005 18:18:58 +0100 (CET) Received: from smtp3.adl2.internode.on.net (smtp3.adl2.internode.on.net [203.16.214.203]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id jB9HItMl001733 for ; Fri, 9 Dec 2005 18:18:57 +0100 Received: from rosella (ppp33-4.lns1.syd6.internode.on.net [59.167.33.4]) by smtp3.adl2.internode.on.net (8.12.9/8.12.6) with ESMTP id jB9HHSC9002589; Sat, 10 Dec 2005 03:47:30 +1030 (CST) (envelope-from skaller@users.sourceforge.net) Subject: Re: [Caml-list] partial application warning unreliable? From: skaller To: Andreas Rossberg Cc: caml-list@yquem.inria.fr In-Reply-To: <439976E0.305@ps.uni-sb.de> References: <1134009551.10435.24.camel@rosella> <20051208.121012.49167263.garrigue@math.nagoya-u.ac.jp> <1134092611.8940.57.camel@rosella> <439976E0.305@ps.uni-sb.de> Content-Type: text/plain Date: Sat, 10 Dec 2005 04:17:28 +1100 Message-Id: <1134148648.8940.167.camel@rosella> Mime-Version: 1.0 X-Mailer: Evolution 2.4.1 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 4399BC7F.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 rossberg:01 iirc:01 malc:01 ocaml:01 wrote:01 wrote:01 sourceforge:01 partial:01 andreas:01 expression:01 explicitly:01 explicitly:01 int:01 int:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 On Fri, 2005-12-09 at 13:21 +0100, Andreas Rossberg wrote: > skaller wrote: > > > > The correct type is void, however unit > > will catch more errors than 'a. > > IIRC, this has been discussed in the past, but since you iterate this > statement repeatedly, let me reinforce that it is incorrect. Well it seems to achieve the desired result in Felix. In particular, neither malc nor myself would have had our bugs slip past the Felix type system the way they slipped past Ocaml. However using unit instead would have caught both our bugs I think, but fail to eliminate: f: int -> 1 g: 1 -> int let x = g ( f 1 ) in which is clearly still wrong -- you should be required to write this as f 1; let x = g () in to explicitly sequence the side effects. Felix allows f: int -> 0 but not g: 0 -> int and thus, the expression: g (f 1) cannot type check (for any g). This forces you to explicitly sequence side effects, which is the intended result. BTW: it isn't clear this is entirely desirable! -- John Skaller Felix, successor to C++: http://felix.sf.net