From 70da89d392d5c9649157e53944db9a49d2149da3 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sun, 1 Nov 2009 14:26:20 -0500 Subject: Initial form for paper assignment --- demo/more/checkGroup.ur | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 demo/more/checkGroup.ur (limited to 'demo/more/checkGroup.ur') diff --git a/demo/more/checkGroup.ur b/demo/more/checkGroup.ur new file mode 100644 index 00000000..ab1cc781 --- /dev/null +++ b/demo/more/checkGroup.ur @@ -0,0 +1,15 @@ +con t ctx data = list (data * xml ctx [] [] * source bool) + +fun create [ctx] [data] (items : list (data * xml ctx [] [] * bool)) = + List.mapM (fn (d, x, b) => s <- source b; return (d, x, s)) items + +fun render [ctx] [data] [[Body] ~ ctx] (t : t ([Body] ++ ctx) data) = + List.mapX (fn (_, x, s) => {x}
) t + +fun selected [ctx] [data] (t : t ctx data) = + List.foldlM (fn (d, _, s) ls => + s <- signal s; + return (if s then + d :: ls + else + ls)) [] t -- cgit v1.2.3