Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* Type equalities in sub modules
@ 2006-12-31  9:35 Daniel Bünzli
  2007-01-02 12:50 ` [Caml-list] " Hendrik Tews
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Bünzli @ 2006-12-31  9:35 UTC (permalink / raw)
  To: caml-list

Hello,

In the example below, is there any way to achieve M.B.t = M.t without  
introducing the intermediate mt type ?

> module M = struct
>   type t = int
>   module B = struct
>     type mt = t
>     type t = mt
>   end
> end

This doesn't work :

> module M = struct
>   type t = int
>   module B = struct
>     type t = M.t
>   end
> end

This doesn't work :

> module M = struct
>   type t = int
>   module B = struct
>     type t = t
>   end
> end

It seems type definitions should have been designed like value  
definitions by having both a 'type' and 'type rec' construct (though  
one can argue this is sufficently rare to justify the above  
inconvenience).

Thanks for your answers,

Daniel


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-01-02 23:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-31  9:35 Type equalities in sub modules Daniel Bünzli
2007-01-02 12:50 ` [Caml-list] " Hendrik Tews
2007-01-02 22:56   ` Till Varoquaux
2007-01-02 23:31     ` Daniel Bünzli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox