Mercurial > urweb
comparison demo/more/orm.urs @ 1002:bb3fc575cfe7
Adapted existing demos to tuple pattern-matching
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Tue, 20 Oct 2009 10:29:17 -0400 |
parents | b132f8620a66 |
children |
comparison
equal
deleted
inserted
replaced
1001:1d456a06ea4e | 1002:bb3fc575cfe7 |
---|---|
1 con link :: (Type * Type) -> Type | 1 con link :: (Type * Type) -> Type |
2 val noParent : t ::: Type -> link (t, unit) | 2 val noParent : t ::: Type -> link (t, unit) |
3 | 3 |
4 con meta = fn col_parent :: (Type * Type) => { | 4 con meta = fn (col :: Type, parent :: Type) => { |
5 Link : link col_parent, | 5 Link : link (col, parent), |
6 Inj : sql_injectable col_parent.1 | 6 Inj : sql_injectable col |
7 } | 7 } |
8 | 8 |
9 val local : t :: Type -> sql_injectable t -> meta (t, unit) | 9 val local : t :: Type -> sql_injectable t -> meta (t, unit) |
10 | 10 |
11 functor Table(M : sig | 11 functor Table(M : sig |
27 val lookup : id -> transaction (option row) | 27 val lookup : id -> transaction (option row) |
28 val list : transaction (list row) | 28 val list : transaction (list row) |
29 | 29 |
30 con col :: Type -> Type | 30 con col :: Type -> Type |
31 val idCol : col id | 31 val idCol : col id |
32 val cols : $(map (fn col_parent :: (Type * Type) => | 32 val cols : $(map (fn (colm :: Type, parent :: Type) => |
33 {Col : col col_parent.1, | 33 {Col : col colm, |
34 Parent : row -> transaction (option col_parent.2)}) M.cols) | 34 Parent : row -> transaction (option parent)}) M.cols) |
35 | 35 |
36 type filter | 36 type filter |
37 val find : filter -> transaction (option row) | 37 val find : filter -> transaction (option row) |
38 val search : filter -> transaction (list row) | 38 val search : filter -> transaction (list row) |
39 | 39 |