Mercurial > urweb
comparison 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 |
comparison
equal
deleted
inserted
replaced
173:8221b95cc24c | 174:7ee424760d2f |
---|---|
1 structure M = struct | |
2 datatype t = A | B | |
3 end | |
4 | |
5 val f = fn x : M.t => case x of M.A => M.B | M.B => M.A | |
6 | |
7 datatype t = datatype M.t | |
8 | |
9 val g = fn x : t => case x of M.A => B | B => M.A | |
10 | |
11 structure N = struct | |
12 datatype t = C of t | D | |
13 end | |
14 | |
15 val h = fn x : N.t => case x of N.C x => x | N.D => M.A | |
16 | |
17 datatype u = datatype N.t | |
18 | |
19 val i = fn x : u => case x of N.C x => x | D => M.A |