Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Type inference question
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-04-26 (13:45)
From: Mark Shinwell <Mark.Shinwell@c...>
Subject: Re: [Caml-list] Type inference question
On Tue, Apr 26, 2005 at 03:41:18PM +0200, Andreas Rossberg wrote:
> 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.

Ah, yes---I had forgotten about that.  Thanks.

Mark Shinwell -- email:
Theory and Semantics Group, University of Cambridge Computer Laboratory