comparison tests/stypes.ur @ 583:1fd4c041634e

Reactive computation with more base types and records
author Adam Chlipala <adamc@hcoop.net>
date Thu, 01 Jan 2009 10:18:20 -0500
parents 66463006f893
children 101eb0058136
comparison
equal deleted inserted replaced
582:66463006f893 583:1fd4c041634e
1 fun main () : transaction page = 1 fun main () : transaction page =
2 sInt <- source 0; 2 sInt <- source 0;
3 sFloat <- source 1.23;
4 sBoth <- source (7, 42.1);
5
6 sOpt <- source None;
7
3 return <xml><body> 8 return <xml><body>
4 <dyn signal={n <- signal sInt; return <xml>{[n]}</xml>}/> <a onclick={set sInt 1}>Change</a><br/> 9 <dyn signal={n <- signal sInt; return <xml>{[n + 3]}</xml>}/> <a onclick={set sInt 1}>Change</a><br/>
10
11 <dyn signal={n <- signal sFloat; return <xml>{[n + 1.0]}</xml>}/> <a onclick={set sFloat 4.56}>Change</a><br/>
12
13 <dyn signal={p <- signal sBoth; return <xml>{[p.1]}, {[p.2]}</xml>}/> <a onclick={set sBoth (8, 100.001)}>Change</a><br/>
5 </body></xml> 14 </body></xml>