comparison tests/functorMania.ur @ 1989:210fb3dfc483

Some more nested functor bug-fixing, including generating fresh internal names at applications; still need to debug issues with datatype constructors
author Adam Chlipala <adam@chlipala.net>
date Thu, 20 Feb 2014 10:27:15 -0500
parents
children
comparison
equal deleted inserted replaced
1988:abb6981a2c4c 1989:210fb3dfc483
1 functor F1(M : sig type t end) = struct
2 type t = M.t
3 fun g () : M.t = g ()
4 fun f () = g ()
5 end
6 functor F2(M : sig type t end) = F1(M)
7 functor F3(M : sig type t end) = F2(M)
8
9 functor F4(M : sig end) = F1(struct type t = int end)
10 functor F5(M : sig end) = F2(struct type t = int end)
11 functor F6(M : sig end) = F3(struct type t = int end)
12
13 functor F7(M : sig end) = F1(struct type t = string end)
14 functor F8(M : sig end) = F2(struct type t = string end)
15 functor F9(M : sig end) = F3(struct type t = string end)
16
17 structure M1 = F1(struct type t = string end)
18 structure M2 = F2(struct type t = string end)
19 structure M3 = F3(struct type t = string end)
20
21 structure M4 = F4(struct end)
22 structure M5 = F5(struct end)
23 structure M6 = F6(struct end)
24
25 structure M7 = F7(struct end)
26 structure M8 = F8(struct end)
27 structure M9 = F9(struct end)
28
29 fun loop x : unit = loop (M1.f (), M2.f (), M3.f (),
30 M4.f (), M5.f (), M6.f (),
31 M7.f (), M8.f (), M9.f ())
32
33 fun main () : transaction page =
34 x <- error <xml/>;
35 u <- return (loop x);
36 return <xml/>