Mercurial > urweb
comparison demo/more/checkGroup.ur @ 1025:7facf72aaf0a
Initial form for paper assignment
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sun, 01 Nov 2009 14:26:20 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
1024:93415bcf54c0 | 1025:7facf72aaf0a |
---|---|
1 con t ctx data = list (data * xml ctx [] [] * source bool) | |
2 | |
3 fun create [ctx] [data] (items : list (data * xml ctx [] [] * bool)) = | |
4 List.mapM (fn (d, x, b) => s <- source b; return (d, x, s)) items | |
5 | |
6 fun render [ctx] [data] [[Body] ~ ctx] (t : t ([Body] ++ ctx) data) = | |
7 List.mapX (fn (_, x, s) => <xml><ccheckbox source={s}/> {x}<br/></xml>) t | |
8 | |
9 fun selected [ctx] [data] (t : t ctx data) = | |
10 List.foldlM (fn (d, _, s) ls => | |
11 s <- signal s; | |
12 return (if s then | |
13 d :: ls | |
14 else | |
15 ls)) [] t |