Mercurial > urweb
diff tests/caseMod.lac @ 174:7ee424760d2f
Elaborating module constructor patterns; parsing record patterns
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Thu, 31 Jul 2008 11:28:55 -0400 |
parents | |
children | 5d030ee143e2 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/caseMod.lac Thu Jul 31 11:28:55 2008 -0400 @@ -0,0 +1,19 @@ +structure M = struct + datatype t = A | B +end + +val f = fn x : M.t => case x of M.A => M.B | M.B => M.A + +datatype t = datatype M.t + +val g = fn x : t => case x of M.A => B | B => M.A + +structure N = struct + datatype t = C of t | D +end + +val h = fn x : N.t => case x of N.C x => x | N.D => M.A + +datatype u = datatype N.t + +val i = fn x : u => case x of N.C x => x | D => M.A