From c2e441e71003b5e49d1dc880f26b25792501342b Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Thu, 8 Jan 2009 10:15:45 -0500 Subject: Injected a polymorphic, recursive type --- tests/jsinj.ur | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests/jsinj.ur') diff --git a/tests/jsinj.ur b/tests/jsinj.ur index 518748d8..f3954085 100644 --- a/tests/jsinj.ur +++ b/tests/jsinj.ur @@ -13,6 +13,13 @@ fun colorToString c = val show_color = mkShow colorToString +datatype list a = Nil | Cons of a * list a + +fun delist ls : xbody = + case ls of + Nil => Nil + | Cons (h, t) => {cdata h} :: {delist t} + cookie int : int cookie float : float cookie string : string @@ -20,6 +27,7 @@ cookie bool : bool cookie pair : int * float cookie option : option int cookie color : color +cookie list : list string fun main () : transaction page = n <- getCookie int; @@ -50,6 +58,10 @@ fun main () : transaction page = c <- return (getOpt c White); sc <- source Blue; + l <- getCookie list; + l <- return (getOpt l (Cons ("A", Cons ("B", Nil)))); + sl <- source Nil; + return {[n]}}/> CHANGE
@@ -73,4 +85,7 @@ fun main () : transaction page = {[c]}}/> CHANGE
+ + {delist l}}/> + CHANGE
-- cgit v1.2.3