comparison demo/more/grid1.ur @ 937:37dd42935dad

Summary row with aggregates
author Adam Chlipala <adamc@hcoop.net>
date Tue, 15 Sep 2009 10:18:56 -0400
parents 2422360c78a3
children e2be476673f2
comparison
equal deleted inserted replaced
936:6966d98c80b5 937:37dd42935dad
43 E = Direct.editable [#E] ! "E" (Direct.nullable Direct.int), 43 E = Direct.editable [#E] ! "E" (Direct.nullable Direct.int),
44 F = Direct.editable [#F] ! "F" (Direct.nullable F.meta), 44 F = Direct.editable [#F] ! "F" (Direct.nullable F.meta),
45 DA = computed "2A" (fn r => 2 * r.A), 45 DA = computed "2A" (fn r => 2 * r.A),
46 Link = computedHtml "Link" (fn r => <xml><a link={page (r.A, r.B)}>Go</a></xml>)} 46 Link = computedHtml "Link" (fn r => <xml><a link={page (r.A, r.B)}>Go</a></xml>)}
47 47
48 val aggregates = {} 48 val aggregates = {Dummy1 = {Initial = (),
49 Step = fn _ _ => (),
50 Display = fn _ => <xml/>},
51 Sum = {Initial = 0,
52 Step = fn r n => r.A + n,
53 Display = txt},
54 Dummy2 = {Initial = (),
55 Step = fn _ _ => (),
56 Display = fn _ => <xml>-</xml>},
57 And = {Initial = True,
58 Step = fn r b => r.C && b,
59 Display = txt}}
49 end) 60 end)
50 61
51 fun main () = 62 fun main () =
52 grid <- grid; 63 grid <- grid;
53 return <xml> 64 return <xml>