I have built several modules including EEA
which match module type PROP
. Now I would like to build 2 functors which looks like follows:
(* zone.ml *)
module type ZONE =
sig
...
end
module ZoneFun (Prop : PROP) = struct
type t =
{ i: int;
pal: ZonesEEA.t }
...
end
(* zones.ml *)
module ZonesFun (Zone: ZONE) = struct
type t = Zone.t list
...
end
Therefore, the functors would allow me to build modules:
(* modules.ml *)
open EEA
open Zone
open Zones
module ZoneEEA = ZoneFun(EEA)
module ZonesEEA = ZonesFun(ZoneEEA)
However, the code does not work because there is a recursion: ZoneFun
requires ZonesEEA.t
, which comes from ZoneEEA
, thus ZoneFun
...
Does anyone have an idea to restructure the code to realize this recursion?