diff options
Diffstat (limited to 'tests/specialize.ur')
-rw-r--r-- | tests/specialize.ur | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/specialize.ur b/tests/specialize.ur index 532463c0..eba7c616 100644 --- a/tests/specialize.ur +++ b/tests/specialize.ur @@ -5,7 +5,7 @@ fun isNil (t ::: Type) (ls : list t) : bool = Nil => True | Cons _ => False -(*fun append (t ::: Type) (ls1 : list t) (ls2 : list t) : list t = +fun append (t ::: Type) (ls1 : list t) (ls2 : list t) : list t = case ls1 of Nil => ls2 | Cons (x, ls1') => Cons (x, append ls1' ls2) @@ -13,14 +13,17 @@ fun isNil (t ::: Type) (ls : list t) : bool = fun delist (ls : list string) : xml body [] [] = case ls of Nil => <body>Nil</body> - | Cons (h, t) => <body>{cdata h} :: {delist t}</body>*) + | Cons (h, t) => <body>{cdata h} :: {delist t}</body> val ls = Cons ("X", Cons ("Y", Cons ("Z", Nil))) +val ls' = Cons ("A", Cons ("B", Nil)) fun main () : transaction page = return <html><body> {if isNil ls then <body>It's Nil.</body> else <body>It's not Nil.</body>} + + <p>{delist (append ls' ls)}</p> </body></html> -(* <p>{delist ls}</p>*) + |