diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/listGroupBy.ur | 13 | ||||
-rw-r--r-- | tests/listGroupBy.urp | 4 |
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/listGroupBy.ur b/tests/listGroupBy.ur new file mode 100644 index 00000000..c2419ce1 --- /dev/null +++ b/tests/listGroupBy.ur @@ -0,0 +1,13 @@ +fun lister () = List.tabulateM (fn _ => n <- rand; return (n % 100)) 8 + +fun main () : transaction page = + inp <- source []; + return <xml><body> + <button value="Compute" onclick={fn _ => + ls <- rpc (lister ()); + set inp ls}/> + + <dyn signal={inp <- signal inp; return (txt inp)}/> + -> + <dyn signal={inp <- signal inp; return (txt (List.groupBy (fn n m => n % 2 = m % 2) inp))}/> + </body></xml> diff --git a/tests/listGroupBy.urp b/tests/listGroupBy.urp new file mode 100644 index 00000000..1a63a89d --- /dev/null +++ b/tests/listGroupBy.urp @@ -0,0 +1,4 @@ +rewrite all ListGroupBy/* + +$/list +listGroupBy
\ No newline at end of file |