diff options
author | Adam Chlipala <adamc@hcoop.net> | 2009-01-01 11:04:09 -0500 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2009-01-01 11:04:09 -0500 |
commit | 6c16d6f8418dbf32b4c17067d7f9617bbdc2ad8f (patch) | |
tree | a5d174cb097382c951b69390af2fe978a3c35b68 /tests/stypes.ur | |
parent | 914c437ab2251be982c4c19f659589360bf41a59 (diff) |
Reactive record pattern
Diffstat (limited to 'tests/stypes.ur')
-rw-r--r-- | tests/stypes.ur | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/stypes.ur b/tests/stypes.ur index 1ac70834..08de343f 100644 --- a/tests/stypes.ur +++ b/tests/stypes.ur @@ -10,7 +10,11 @@ fun main () : transaction page = <dyn signal={n <- signal sFloat; return <xml>{[n + 1.0]}</xml>}/> <a onclick={set sFloat 4.56}>Change</a><br/> - <dyn signal={p <- signal sBoth; return <xml>{[p.1]}, {[p.2]}</xml>}/> <a onclick={set sBoth (8, 100.001)}>Change</a><br/> + <dyn signal={p <- signal sBoth; return <xml>{[p.1]}, {[p.2]}</xml>}/>; + <dyn signal={p <- signal sBoth; case p of + (7, _) => return <xml>Initial</xml> + | (fst, snd) => return <xml>{[fst]}, {[snd]}</xml>}/> + <a onclick={set sBoth (8, 100.001)}>Change</a><br/> <dyn signal={o <- signal sOpt; case o of None => return <xml>None</xml> |