From 7bc788c67ed9331773355ceeae4ace7923a6e914 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Thu, 11 Sep 2008 09:36:47 -0400 Subject: Unpoly non-recursive function --- tests/specialize.ur | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tests/specialize.ur (limited to 'tests/specialize.ur') diff --git a/tests/specialize.ur b/tests/specialize.ur new file mode 100644 index 00000000..532463c0 --- /dev/null +++ b/tests/specialize.ur @@ -0,0 +1,26 @@ +datatype list a = Nil | Cons of a * list a + +fun isNil (t ::: Type) (ls : list t) : bool = + case ls of + Nil => True + | Cons _ => False + +(*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) + +fun delist (ls : list string) : xml body [] [] = + case ls of + Nil => Nil + | Cons (h, t) => {cdata h} :: {delist t}*) + +val ls = Cons ("X", Cons ("Y", Cons ("Z", Nil))) + +fun main () : transaction page = return + {if isNil ls then It's Nil. else It's not Nil.} + + + +(*

{delist ls}

*) + -- cgit v1.2.3