annotate demo/more/grid.urs @ 936:6966d98c80b5

Include 'key' type in Grid
author Adam Chlipala <adamc@hcoop.net>
date Tue, 15 Sep 2009 09:45:46 -0400
parents 2422360c78a3
children 37dd42935dad
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@915 35 end) : sig
adamc@915 36 type grid
adamc@915 37
adamc@915 38 val grid : transaction grid
adamc@915 39 val sync : grid -> transaction unit
adamc@915 40 val render : grid -> xbody
adamc@915 41
adamc@915 42 style tabl
adamc@915 43 style tr
adamc@915 44 style th
adamc@915 45 style td
adamc@915 46 end