From b404fdb16497e263484383464234f3ddf1d62150 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Thu, 11 Sep 2008 10:14:59 -0400 Subject: Unpolyed a polymorphic function of two arguments --- tests/specialize.ur | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'tests/specialize.ur') 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 => Nil - | Cons (h, t) => {cdata h} :: {delist t}*) + | Cons (h, t) => {cdata h} :: {delist t} val ls = Cons ("X", Cons ("Y", Cons ("Z", Nil))) +val ls' = Cons ("A", Cons ("B", Nil)) fun main () : transaction page = return {if isNil ls then It's Nil. else It's not Nil.} + +

{delist (append ls' ls)}

-(*

{delist ls}

*) + -- cgit v1.2.3