-
Notifications
You must be signed in to change notification settings - Fork 16
/
chooseForeign.urs
46 lines (36 loc) · 1.73 KB
/
chooseForeign.urs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
(* Widget to help the user choose a subset of applicable rows of a table.
* We work with a few different kinds of DB columns:
* - [const]: columns whose values are fixed at compile time
* - [given]: columns whose values are fixed at runtime
* - [chosen]: columns where the user has some say at runtime
*)
functor Make(M : sig
con const :: {Type}
con given :: {Type}
con chosen :: {Type}
constraint const ~ given
constraint (const ++ given) ~ chosen
val const : $const
table choices : (const ++ given ++ chosen)
con optionsConst :: {Type}
con others :: {Type}
constraint others ~ chosen
constraint (others ++ chosen) ~ optionsConst
table options : (optionsConst ++ chosen ++ others)
val optionsConst : $optionsConst
val constFl : folder const
val givenFl : folder given
val chosenFl : folder chosen
val optionsConstFl : folder optionsConst
val constInj : $(map sql_injectable const)
val givenInj : $(map sql_injectable given)
val chosenInj : $(map sql_injectable chosen)
val optionsConstInj : $(map sql_injectable optionsConst)
val chosenShow : show $chosen
val chosenRead : read $chosen
val chosenEq : eq $chosen
val givenEq : eq $given
val buttonLabel : string
(* Authentication *)
val amGiven : transaction (option $given)
end) : Ui.S where type input = $M.given