-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathglobalDiscussion.ur
60 lines (45 loc) · 2.06 KB
/
globalDiscussion.ur
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
58
59
60
functor Make(M : sig
type text_internal
type text_config
val text : Widget.t string text_internal text_config
val access : 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) = struct
open M
table message : {Thread : time, When : time, Who : string, Text : string}
PRIMARY KEY(Thread, When)
open Discussion.Make(struct
open M
con key = []
con thread = #Thread
constraint [thread] ~ [When, Who, Text, Closed, Private]
val fl = _
con message_hidden_constraints = _
con empty :: {{Unit}} = []
constraint empty ~ message_hidden_constraints
val message = message
val kinj = {}
constraint key ~ [Thread, When, Who, Text, Closed]
val access () = access
end)
val ui = ui ()
functor Todo(N : sig
con tag :: Name
con user :: Name
con aother :: {Type}
constraint [user] ~ aother
table assignments : ([user = option string] ++ aother)
val title : string
val render : {Thread : time} -> string (* username *) -> xbody
end) = struct
open Todo(struct
open N
constraint [Assignee, Due, Done, Kind] ~ [Thread = time]
val inj = _
end)
end
end