Mercurial > urweb
comparison demo/more/grid.urs @ 944:da3ec6014d2f
Filters implementation type-checking
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Tue, 15 Sep 2009 15:48:53 -0400 |
parents | e2194a6793ae |
children | 8c37699de273 |
comparison
equal
deleted
inserted
replaced
943:e2194a6793ae | 944:da3ec6014d2f |
---|---|
1 con colMeta' = fn (row :: Type) (t :: Type) => | 1 con colMeta' = fn (row :: Type) (input :: Type) (filter :: Type) => |
2 {Header : string, | 2 {Header : string, |
3 Project : row -> transaction t, | 3 Project : row -> transaction input, |
4 Update : row -> t -> transaction row, | 4 Update : row -> input -> transaction row, |
5 Display : t -> xbody, | 5 Display : input -> xbody, |
6 Edit : t -> xbody, | 6 Edit : input -> xbody, |
7 Validate : t -> signal bool} | 7 Validate : input -> signal bool, |
8 CreateFilter : transaction filter, | |
9 DisplayFilter : filter -> xbody, | |
10 Filter : filter -> row -> signal bool} | |
8 | 11 |
9 con colMeta = fn (row :: Type) (global_t :: (Type * Type)) => | 12 con colMeta = fn (row :: Type) (global_input_filter :: (Type * Type * Type)) => |
10 {Initialize : transaction global_t.1, | 13 {Initialize : transaction global_input_filter.1, |
11 Handlers : global_t.1 -> colMeta' row global_t.2} | 14 Handlers : global_input_filter.1 -> colMeta' row global_input_filter.2 global_input_filter.3} |
12 | 15 |
13 con aggregateMeta = fn (row :: Type) (acc :: Type) => | 16 con aggregateMeta = fn (row :: Type) (acc :: Type) => |
14 {Initial : acc, | 17 {Initial : acc, |
15 Step : row -> acc -> acc, | 18 Step : row -> acc -> acc, |
16 Display : acc -> xbody} | 19 Display : acc -> xbody} |
23 val list : transaction (list row) | 26 val list : transaction (list row) |
24 val new : transaction row | 27 val new : transaction row |
25 val save : key -> row -> transaction unit | 28 val save : key -> row -> transaction unit |
26 val delete : key -> transaction unit | 29 val delete : key -> transaction unit |
27 | 30 |
28 con cols :: {(Type * Type)} | 31 con cols :: {(Type * Type * Type)} |
29 val cols : $(map (colMeta row) cols) | 32 val cols : $(map (colMeta row) cols) |
30 | 33 |
31 val folder : folder cols | 34 val folder : folder cols |
32 | 35 |
33 con aggregates :: {Type} | 36 con aggregates :: {Type} |