summaryrefslogtreecommitdiff
path: root/tests/specialize.ur
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-09-11 10:14:59 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-09-11 10:14:59 -0400
commitb404fdb16497e263484383464234f3ddf1d62150 (patch)
treec8ffe0ed690301c79e9a40ece3de7727355e87b4 /tests/specialize.ur
parent7bc788c67ed9331773355ceeae4ace7923a6e914 (diff)
Unpolyed a polymorphic function of two arguments
Diffstat (limited to 'tests/specialize.ur')
-rw-r--r--tests/specialize.ur9
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>*)
+