Mercurial > urweb
annotate demo/more/grid.urs @ 935:2422360c78a3
Dropped in initial aggregate types
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Tue, 15 Sep 2009 09:40:51 -0400 |
parents | 5e8b6fa5b48f |
children | 6966d98c80b5 |
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@915 | 20 val list : transaction (list row) |
adamc@915 | 21 val new : transaction row |
adamc@915 | 22 val save : {Old : row, New : row} -> transaction unit |
adamc@915 | 23 val delete : row -> transaction unit |
adamc@915 | 24 |
adamc@915 | 25 con cols :: {(Type * Type)} |
adamc@915 | 26 val cols : $(map (colMeta row) cols) |
adamc@915 | 27 |
adamc@915 | 28 val folder : folder cols |
adamc@935 | 29 |
adamc@935 | 30 con aggregates :: {Type} |
adamc@935 | 31 val aggregates : $(map (aggregateMeta row) aggregates) |
adamc@915 | 32 end) : sig |
adamc@915 | 33 type grid |
adamc@915 | 34 |
adamc@915 | 35 val grid : transaction grid |
adamc@915 | 36 val sync : grid -> transaction unit |
adamc@915 | 37 val render : grid -> xbody |
adamc@915 | 38 |
adamc@915 | 39 style tabl |
adamc@915 | 40 style tr |
adamc@915 | 41 style th |
adamc@915 | 42 style td |
adamc@915 | 43 end |