Mercurial > urweb
view tests/rpcDD.ur @ 1445:6e6f1643c4e9
To generate server-side source JavaScript, try both the old and new strategies; remove an unsound optimization from MonoOpt and make MonoReduce work harder to compensate
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Mon, 28 Mar 2011 10:37:49 -0400 |
parents | 63b0bcacd535 |
children |
line wrap: on
line source
datatype list t = Nil | OtherNil | Cons of t * list t table t : {A : int} fun main () : transaction page = let fun rows () = query (SELECT * FROM t) (fn r ls => return (Cons (r.T.A, ls))) Nil fun show ls = case ls of Nil => <xml/> | OtherNil => <xml>That's impossible!</xml> | Cons (x, ls') => <xml>{[x]}<br/>{show ls'}</xml> in s <- source Nil; return <xml><body> <button value="Get It On!" onclick={ls <- rows (); set s ls}/><br/> <br/> Current: <dyn signal={ls <- signal s; return (show ls)}/> </body></xml> end