Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Comments on type variables
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Laurent Vibert <lvibert@i...>
Subject: Re: [Caml-list] Comments on type variables
On Fri, 7 Jun 2002, Jacques Garrigue wrote:

> > Interaction with local modules
> > ------------------------------
> > 
> > Inside a local module, type variables introduced outside the module are
> > invisible:
> > 
> > # let f (x : 'a) =
> >     let module M = struct type t = 'a list end in ();;
> > Unbound type parameter 'a
> 
> To be expected by the rules above. Functions with local modules are
> not functors. 'a is not a type constructor.

this has a draw-back : some local modules don't have any valid
signature :
for exemple, what is the signature of the module M ?

let f (x:'a) = 
  let module M = struct let v = x end
  in ...

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners