blob: 7ff754081c3b8405490377e64e0d750142a6f69b (
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
|
(.module:
[lux #*
[data
[product]]
[type
abstract]])
(abstract: #export (Tainted a)
a
(def: #export taint
(All [a] (-> a (Tainted a)))
(|>> :abstraction))
(def: #export trust
(All [a] (-> (Tainted a) a))
(|>> :representation)))
(def: #export (validate pred tainted)
(All [a] (-> (-> a Bit) (Tainted a) (Maybe a)))
(let [value (trust tainted)]
(if (pred value)
(#.Some value)
#.None)))
(def: #export (sanitize f tainted)
(All [a] (-> (-> a a) (Tainted a) a))
(|> tainted trust f))
|