blob: 583b69bb52852bc98f6f29e670a5d05236b18462 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
(* PR#4450 *)
module PR_4450_1 = struct
module type MyT = sig type 'a t = Succ of 'a t end
module MyMap(X : MyT) = X
module rec MyList : MyT = MyMap(MyList)
end;;
module PR_4450_2 = struct
module type MyT = sig
type 'a wrap = My of 'a t
and 'a t = private < map : 'b. ('a -> 'b) ->'b wrap; .. >
val create : 'a list -> 'a t
end
module MyMap(X : MyT) = struct
include X
class ['a] c l = object (self)
method map : 'b. ('a -> 'b) -> 'b wrap =
fun f -> My (create (List.map f l))
end
end
module rec MyList : sig
type 'a wrap = My of 'a t
and 'a t = < map : 'b. ('a -> 'b) ->'b wrap >
val create : 'a list -> 'a t
end = struct
include MyMap(MyList)
let create l = new c l
end
end;;
|