Browse thread
recursive modules: Cannot safely evaluate the definition
-
Hendrik Tews
-
Keiko Nakata
- Jean-Christophe_Filliâtre
-
Keiko Nakata
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 2008-04-04 (12:43) |
From: | Jean-Christophe_Filliâtre <Jean-Christophe.Filliatre@l...> |
Subject: | Re: [Caml-list] recursive modules: Cannot safely evaluate the definition |
Keiko Nakata wrote: > Hello. > > I think that functors cannot be recursive in the current OCaml. They can: ----------------------------------------------------------------- module type S = sig type t = int end module rec F : functor(X : S) -> S = functor(X: S) -> struct type t = M.t end and M : S = F(struct type t = int end) let x : M.t = 42 ----------------------------------------------------------------- But it is likely that you won't do anything useful with a functor like this (try adding a "val x : t" in the signature and to define x in F as equal to M.x and you'll bump on the "Cannot safely evaluate the definition of ..." error). -- Jean-Christophe