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

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Francois Pottier <Francois.Pottier@i...>
Subject: Re: [Caml-list] renaming a type

>  Unfortunately it does not work is I instantiate a polymorphic type with the
> same idea:
> 
> # module M = struct type 'a t = T end;;
> module M : sig type 'a t = T end
> # type t' = int M.t = T;;
>        ^^^^^^^^^^^^^^^^

Why not do it in two steps?

# module M = struct type 'a t = T end;;
module M : sig type 'a t = T end
# type 'a t' = 'a M.t = T;;
type 'a t' = 'a M.t = T
# type t'' = int t';;
type t'' = int t'

Clearly very clumsy, of course, but it works.

-- 
François Pottier
Francois.Pottier@inria.fr
http://pauillac.inria.fr/~fpottier/
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr