blob: 094ede9a6146ccbc4aadf3b9208712d6e3f8496a (
plain)
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
|
(.module:
[lux #*
[control
[equivalence (#+ Equivalence)]
[security
[capability (#+ Capability)]]]
[type
abstract]])
(abstract: #export (ID code entity storage)
{#.doc "A value that uniquely identifies an entity in some foreign data storage (such as a database)."}
code
(structure: #export (Equivalence<ID> Equivalence<code>)
(All [code entity storage]
(-> (Equivalence code)
(Equivalence (ID code entity storage))))
(def: (= reference sample)
(:: Equivalence<code> =
(:representation reference)
(:representation sample))))
(type: #export (Can-Identify code storage)
(All [entity]
(Capability code
(ID code entity storage))))
(type: #export (Can-Anonymize code storage)
(All [entity]
(Capability (ID code entity storage)
code)))
(type: #export (Service code)
(Ex [storage]
[(Can-Identify code storage)
(Can-Anonymize code storage)]))
(def: Service<_>
(All [code storage] (Service code storage))
[(|>> :abstraction)
(|>> :representation)])
(type: #export (Context code scope storage)
(-> (Service code storage)
(scope storage)))
(def: #export (service _)
(All [code]
(Ex [storage]
(-> Any (Service code storage))))
..Service<_>)
(def: #export (with-identity context)
(All [code scope]
(Ex [storage]
(-> (Context code scope storage)
(scope storage))))
(context ..Service<_>))
)
|