diff tests/specialize.ur @ 316:04ebfe929a98

Unpolyed a polymorphic function of two arguments
author Adam Chlipala <adamc@hcoop.net>
date Thu, 11 Sep 2008 10:14:59 -0400
parents e21d0dddda09
children 6a4e365db60c
line wrap: on
line diff
--- a/tests/specialize.ur	Thu Sep 11 09:36:47 2008 -0400
+++ b/tests/specialize.ur	Thu Sep 11 10:14:59 2008 -0400
@@ -5,7 +5,7 @@
           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 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>*)
 
+