comparison tests/functor.lac @ 44:a9f3ce2d1b9b

Elaborating functor applications
author Adam Chlipala <adamc@hcoop.net>
date Thu, 19 Jun 2008 17:04:08 -0400
parents d94c484337d0
children 44a1bc863f0f
comparison
equal deleted inserted replaced
43:d94c484337d0 44:a9f3ce2d1b9b
16 16
17 structure F2 : functor (M : S) : T where type t = M.t = F 17 structure F2 : functor (M : S) : T where type t = M.t = F
18 structure F3 : functor (M : S) : T = F 18 structure F3 : functor (M : S) : T = F
19 (*structure F4 : functor (M : S) : sig type q end = F*) 19 (*structure F4 : functor (M : S) : sig type q end = F*)
20 (*structure F5 : functor (M : S) : T where type t = int = F*) 20 (*structure F5 : functor (M : S) : T where type t = int = F*)
21
22
23 structure O = F (struct
24 type t = int
25 val z = 0
26 val s = fn x : t => x
27 end)
28 val three : int = O.three
29
30 structure S = struct
31 type t = int
32 val z = 0
33 val s = fn x : t => x
34 end
35 structure SO = F (S)
36 val three : int = SO.three
37
38 structure SS : S = S
39 structure SSO = F (SS)
40 val three : SS.t = SSO.three