Mercurial > urweb
annotate demo/more/checkGroup.ur @ 1249:7c6fc92f6c31
Complain about DValRec; optimizations for unit-valued ECase and forgetting of path conditions across ESeq
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Thu, 29 Apr 2010 11:47:24 -0400 |
parents | 7facf72aaf0a |
children |
rev | line source |
---|---|
adamc@1025 | 1 con t ctx data = list (data * xml ctx [] [] * source bool) |
adamc@1025 | 2 |
adamc@1025 | 3 fun create [ctx] [data] (items : list (data * xml ctx [] [] * bool)) = |
adamc@1025 | 4 List.mapM (fn (d, x, b) => s <- source b; return (d, x, s)) items |
adamc@1025 | 5 |
adamc@1025 | 6 fun render [ctx] [data] [[Body] ~ ctx] (t : t ([Body] ++ ctx) data) = |
adamc@1025 | 7 List.mapX (fn (_, x, s) => <xml><ccheckbox source={s}/> {x}<br/></xml>) t |
adamc@1025 | 8 |
adamc@1025 | 9 fun selected [ctx] [data] (t : t ctx data) = |
adamc@1025 | 10 List.foldlM (fn (d, _, s) ls => |
adamc@1025 | 11 s <- signal s; |
adamc@1025 | 12 return (if s then |
adamc@1025 | 13 d :: ls |
adamc@1025 | 14 else |
adamc@1025 | 15 ls)) [] t |