Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: "Daniel Bünzli" <daniel.buenzli@epfl.ch>
To: caml-list@yquem.inria.fr
Subject: Type equalities in sub modules
Date: Sun, 31 Dec 2006 10:35:29 +0100	[thread overview]
Message-ID: <F62629D5-5795-45BA-9A12-2A5727334C66@epfl.ch> (raw)

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


             reply	other threads:[~2006-12-31  9:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-31  9:35 Daniel Bünzli [this message]
2007-01-02 12:50 ` [Caml-list] " Hendrik Tews
2007-01-02 22:56   ` Till Varoquaux
2007-01-02 23:31     ` Daniel Bünzli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F62629D5-5795-45BA-9A12-2A5727334C66@epfl.ch \
    --to=daniel.buenzli@epfl.ch \
    --cc=caml-list@yquem.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox