Browse thread
recursive modules: Cannot safely evaluate the definition
[
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: | -- (:) |
| From: | Keiko Nakata <keiko@k...> |
| Subject: | Re: [Caml-list] recursive modules: Cannot safely evaluate the definition |
Thank you for the correction and citation.
> Keiko Nakata wrote:
> > I think that functors cannot be recursive in the current OCaml.
Yes, I was incorrect.
We have:
module rec F: functor (X:sig end) -> sig val f : int -> int end =
functor(X:sig end) -> struct
let f x = if x = 0 then 0 else M.f (x-1)
end
and M : sig val f: int -> int end = F(M)
This should imply interesting examples are available.
Best,
Keiko