diff options
author | Adam Chlipala <adamc@hcoop.net> | 2008-10-21 15:11:42 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2008-10-21 15:11:42 -0400 |
commit | a3418cf924752accf2f68fc2673da2a661276ae5 (patch) | |
tree | 13d980071b5e6d9402189836c87e1302b3f0acd9 /tests | |
parent | 5e4a0f3fbfb025c17488b5f066988ee1da030825 (diff) |
Recursive unurlify for Default datatypes
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unurlify.ur | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/unurlify.ur b/tests/unurlify.ur index 4bb523c1..bb3b1e0b 100644 --- a/tests/unurlify.ur +++ b/tests/unurlify.ur @@ -2,6 +2,19 @@ datatype list t = Nil | Cons of t * list t fun handler (ls : list bool) = return <xml/> +datatype wlist = WNil | Empty | WCons of bool * wlist + +fun whandler' (ls : wlist) = + case ls of + WNil => <xml>Nil</xml> + | Empty => <xml>Empty</xml> + | WCons (x, ls') => <xml>{[x]} :: {whandler' ls'}</xml> + +fun whandler ls = return (whandler' ls) + fun main () : transaction page = return <xml><body> - <a link={handler Nil}>!</a> + <a link={handler Nil}>!</a><br/> + <a link={whandler WNil}>Nil</a><br/> + <a link={whandler Empty}>Empty</a><br/> + <a link={whandler (WCons (True, WCons (False, Empty)))}>True :: False :: Empty</a><br/> </body></xml> |