-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtableDiscussion.urs
57 lines (50 loc) · 2.38 KB
/
tableDiscussion.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
47
48
49
50
51
52
53
54
55
56
57
(* Specialization of Discussion using foreign keys *)
functor Make(M : sig
con key1 :: Name
type keyT
con keyR :: {Type}
constraint [key1] ~ keyR
con key = [key1 = keyT] ++ keyR
con thread :: Name
constraint [thread] ~ key
constraint [thread] ~ [When, Who, Text, Closed, Private, Subject]
constraint key ~ [Thread, When, Who, Text, Closed, Private]
val fl : folder key
val kinj : $(map sql_injectable_prim key)
con rest :: {Type}
constraint rest ~ key
con keyName :: Name
con otherConstraints :: {{Unit}}
constraint [keyName] ~ otherConstraints
val parent : sql_table (key ++ rest) ([keyName = map (fn _ => ()) key] ++ otherConstraints)
type text_internal
type text_config
val text : Widget.t string text_internal text_config
val access : $key -> transaction Discussion.access
val showOpenVsClosed : bool
val allowPrivate : bool
val onNewMessage : transaction (list string)
-> {thread : time, Subject : string, Who : string, Text : string}
-> transaction unit
end) : sig
include Ui.S where type input = $M.key
con thread = M.thread
(* Generate todo items for users tasked with responding to messages. *)
functor Todo(N : sig
con tag :: Name
con user :: Name
con aother :: {Type}
constraint M.key ~ aother
constraint [user] ~ (M.key ++ aother)
constraint [Assignee, Due, Done, Kind] ~ (M.key ++ [thread = time])
val inj : $(map sql_injectable_prim M.key)
table assignments : (M.key ++ [user = option string] ++ aother)
(* Recording who is responsible for which items *)
val title : string
val render : $(M.key ++ [thread = time]) -> string (* username *) -> xbody
end) : sig
type private
con tag = N.tag
val todo : Todo.t ([thread = time] ++ M.key) [tag = private]
end
end