Mercurial > urweb
annotate tests/redirect.ur @ 2044:42ae25a354f8
Retweak the last tweak to allow type inference to succeed in a strict superset of the places where it used to succeed
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Tue, 29 Jul 2014 14:46:06 -0400 |
parents | 217eb87dde31 |
children |
rev | line source |
---|---|
adamc@1065 | 1 fun other () = redirect (bless "http://www.google.com/") |
adamc@1065 | 2 |
adamc@1065 | 3 fun further () = case checkUrl "http://www.google.com/" of |
adamc@1065 | 4 None => return <xml>Darn.</xml> |
adamc@1065 | 5 | Some url => redirect url |
adamc@1065 | 6 |
adamc@1065 | 7 fun failing () = case checkUrl "http://www.yahoo.com/" of |
adamc@1065 | 8 None => return <xml>Darn.</xml> |
adamc@1065 | 9 | Some url => redirect url |
adamc@1065 | 10 |
adamc@1065 | 11 fun main () = return <xml><body> |
adamc@1065 | 12 <a link={other ()}>Go there</a><br/> |
adamc@1065 | 13 <a link={further ()}>Go also there</a><br/> |
adamc@1065 | 14 <a link={failing ()}>Fail there</a> |
adamc@1065 | 15 </body></xml> |