view tests/datatypeMod.lac @ 159:1e382d10e832

Abstracting datatypes with signature ascription
author Adam Chlipala <adamc@hcoop.net>
date Thu, 24 Jul 2008 16:41:12 -0400
parents b4b70de488e9
children 870e8abbe3b9
line wrap: on
line source
structure M : sig datatype t = A | B end = struct
        datatype t = A | B
end

val a = M.A

datatype u = datatype M.t

val a : M.t = A
val a2 : u = a

structure M2 = M
structure M3 : sig datatype t = datatype M.t end = M2
structure M4 : sig datatype t = datatype M.t end = M

val b : M3.t = M4.B

structure Ma : sig type t end = M