annotate demo/more/grid.urs @ 937:37dd42935dad

Summary row with aggregates
author Adam Chlipala <adamc@hcoop.net>
date Tue, 15 Sep 2009 10:18:56 -0400
parents 6966d98c80b5
children e2be476673f2
rev   line source
adamc@915 1 con colMeta' = fn (row :: Type) (t :: Type) =>
adamc@915 2 {Header : string,
adamc@915 3 Project : row -> transaction t,
adamc@915 4 Update : row -> t -> transaction row,
adamc@915 5 Display : t -> xbody,
adamc@915 6 Edit : t -> xbody,
adamc@915 7 Validate : t -> signal bool}
adamc@915 8
adamc@915 9 con colMeta = fn (row :: Type) (global_t :: (Type * Type)) =>
adamc@915 10 {Initialize : transaction global_t.1,
adamc@915 11 Handlers : global_t.1 -> colMeta' row global_t.2}
adamc@915 12
adamc@935 13 con aggregateMeta = fn (row :: Type) (acc :: Type) =>
adamc@935 14 {Initial : acc,
adamc@935 15 Step : row -> acc -> acc,
adamc@935 16 Display : acc -> xbody}
adamc@935 17
adamc@915 18 functor Make(M : sig
adamc@915 19 type row
adamc@936 20 type key
adamc@936 21 val keyOf : row -> key
adamc@936 22
adamc@915 23 val list : transaction (list row)
adamc@915 24 val new : transaction row
adamc@936 25 val save : key -> row -> transaction unit
adamc@936 26 val delete : key -> transaction unit
adamc@915 27
adamc@915 28 con cols :: {(Type * Type)}
adamc@915 29 val cols : $(map (colMeta row) cols)
adamc@915 30
adamc@915 31 val folder : folder cols
adamc@935 32
adamc@935 33 con aggregates :: {Type}
adamc@935 34 val aggregates : $(map (aggregateMeta row) aggregates)
adamc@937 35 val aggFolder : folder aggregates
adamc@915 36 end) : sig
adamc@915 37 type grid
adamc@915 38
adamc@915 39 val grid : transaction grid
adamc@915 40 val sync : grid -> transaction unit
adamc@915 41 val render : grid -> xbody
adamc@915 42
adamc@915 43 style tabl
adamc@915 44 style tr
adamc@915 45 style th
adamc@915 46 style td
adamc@915 47 end