comparison demo/more/conference.urs @ 1022:4de35df3d545

Start of bidding implementation compiles
author Adam Chlipala <adamc@hcoop.net>
date Sat, 31 Oct 2009 15:51:50 -0400
parents 16f7cb0891b6
children e46227efcbba
comparison
equal deleted inserted replaced
1021:7a4a55e05081 1022:4de35df3d545
1 signature INPUT = sig
2 con paper :: {(Type * Type)}
3 constraint [Id, Document] ~ paper
4
5 type userId
6 val userId_inj : sql_injectable_prim userId
7 table user : {Id : userId, Nam : string, Password : string, Chair : bool, OnPc : bool}
8 PRIMARY KEY Id,
9 CONSTRAINT Nam UNIQUE Nam
10
11 type paperId
12 val paperId_inj : sql_injectable_prim paperId
13 table paper : ([Id = paperId, Document = blob] ++ map fst paper)
14 PRIMARY KEY Id
15
16 val checkLogin : transaction (option {Id : userId, Nam : string, Chair : bool, OnPc : bool})
17 val getLogin : transaction {Id : userId, Nam : string, Chair : bool, OnPc : bool}
18 end
19
20 signature OUTPUT = sig
21 type userId
22 type paperId
23
24 val linksForPc : xbody
25
26 con yourPaperTables :: {{Type}}
27 constraint [Paper] ~ yourPaperTables
28 val joinYourPaper : tabs ::: {{Type}} -> paper ::: {Type}
29 -> [[Paper] ~ tabs] => [[Paper] ~ yourPaperTables] => [tabs ~ yourPaperTables] => [[Id] ~ paper] =>
30 sql_from_items ([Paper = [Id = paperId] ++ paper] ++ tabs)
31 -> sql_from_items (yourPaperTables ++ [Paper = [Id = paperId] ++ paper] ++ tabs)
32 end
33
1 functor Make(M : sig 34 functor Make(M : sig
2 con paper :: {(Type * Type)} 35 con paper :: {(Type * Type)}
3 constraint [Id, Document, Authors] ~ paper 36 constraint [Id, Document, Authors] ~ paper
4 val paper : $(map Meta.meta paper) 37 val paper : $(map Meta.meta paper)
5 val paperFolder : folder paper 38 val paperFolder : folder paper
9 val review : $(map Meta.meta review) 42 val review : $(map Meta.meta review)
10 val reviewFolder : folder review 43 val reviewFolder : folder review
11 44
12 val submissionDeadline : time 45 val submissionDeadline : time
13 val summarizePaper : $(map fst paper) -> xbody 46 val summarizePaper : $(map fst paper) -> xbody
47
48 functor Make (M : INPUT where con paper = paper)
49 : OUTPUT where con userId = M.userId
50 where con paperId = M.paperId
14 end) : sig 51 end) : sig
15 52
16 val main : unit -> transaction page 53 val main : unit -> transaction page
17 54
18 end 55 end