From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 864CABC84 for ; Tue, 26 Apr 2005 15:42:00 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j3QDg0UW009116 for ; Tue, 26 Apr 2005 15:42:00 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id PAA26844 for ; Tue, 26 Apr 2005 15:41:59 +0200 (MET DST) Received: from justus.rz.uni-saarland.de (justus.rz.uni-saarland.de [134.96.7.31]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j3QDfxtd002397 for ; Tue, 26 Apr 2005 15:41:59 +0200 Received: from uni-sb.de (uni-sb.de [134.96.7.230]) by justus.rz.uni-saarland.de (8.12.10/8.12.10) with ESMTP id j3QDfrHs601507 for ; Tue, 26 Apr 2005 15:41:54 +0200 (CEST) Received: from cs.uni-sb.de (cs.uni-sb.de [134.96.252.31]) by uni-sb.de (8.13.4/2005033000) with ESMTP id j3QDfK0h025370; Tue, 26 Apr 2005 15:41:21 +0200 (CEST) Received: from mail.cs.uni-sb.de (mail.cs.uni-sb.de [134.96.254.200]) by cs.uni-sb.de (8.13.4/2005033000) with ESMTP id j3QDfKB5023714; Tue, 26 Apr 2005 15:41:20 +0200 (CEST) Received: from ps.uni-sb.de (grizzly.ps.uni-sb.de [134.96.186.68]) by mail.cs.uni-sb.de (8.13.4/2005033000) with ESMTP id j3QDfJmB018394; Tue, 26 Apr 2005 15:41:19 +0200 (CEST) X-Authentication-Warning: mail.cs.uni-sb.de: Host grizzly.ps.uni-sb.de [134.96.186.68] claimed to be ps.uni-sb.de Received: from ps.uni-sb.de (groove.ps.uni-sb.de [134.96.186.172]) by ps.uni-sb.de (8.12.10/8.12.10) with ESMTP id j3QDfI2Z013901; Tue, 26 Apr 2005 15:41:18 +0200 Message-ID: <426E44FE.2000003@ps.uni-sb.de> Date: Tue, 26 Apr 2005 15:41:18 +0200 From: Andreas Rossberg User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1) Gecko/20031114 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Mark Shinwell Cc: caml-list@inria.fr Subject: Re: [Caml-list] Type inference question References: <17006.11606.297786.728905@gargle.gargle.HOWL> <20050426131907.GA10841@three-tuns.net> In-Reply-To: <20050426131907.GA10841@three-tuns.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-1.5.1 (justus.rz.uni-saarland.de [134.96.7.31]); Tue, 26 Apr 2005 15:41:54 +0200 (CEST) X-AntiVirus: checked by AntiVir Milter 1.0.6; AVE 6.30.0.7; VDF 6.30.0.135 X-Miltered: at concorde with ID 426E4528.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 426E4527.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; rossberg:01 rossberg:01 caml-list:01 inference:01 shinwell:01 stdin:01 sml:01 nonexpansive:01 mutable:01 ocaml:01 ocaml:01 cheers:01 wrote:01 uni-sb:01 uni-sb:01 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: Mark Shinwell wrote: > > However, in the Marshal example above, we have > > Marshal.from_channel stdin [] > > in the first part of the "let". In the SML terminology, this is not a > "nonexpansive expression"[*] (unlike "fun x -> x"). Therefore, I would > have thought that the appearance of such an expression here would > prohibit generalisation (in order to prevent possible unsoundness in the > presence of mutable state). This is presumably not the case in OCaml: > can someone explain why? Recent versions of OCaml employ a slightly relaxed variant of the value restriction that allows generalising of variables in covariant position, because that is always safe. Cheers, - Andreas -- Andreas Rossberg, rossberg@ps.uni-sb.de Let's get rid of those possible thingies! -- TB