diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/library/lux/control/security/policy.lux | 146 |
1 files changed, 71 insertions, 75 deletions
diff --git a/stdlib/source/library/lux/control/security/policy.lux b/stdlib/source/library/lux/control/security/policy.lux index 498469d63..f0a55bdd4 100644 --- a/stdlib/source/library/lux/control/security/policy.lux +++ b/stdlib/source/library/lux/control/security/policy.lux @@ -9,89 +9,85 @@ abstract]]]) (abstract: .public (Policy brand value label) - {} - value - (type: .public (Can_Upgrade brand label value) - (-> value (Policy brand value label))) - - (type: .public (Can_Downgrade brand label value) - (-> (Policy brand value label) value)) - - (type: .public (Privilege brand label) - (Record - [#can_upgrade (Can_Upgrade brand label) - #can_downgrade (Can_Downgrade brand label)])) - - (type: .public (Delegation brand from to) - (All (_ value) - (-> (Policy brand value from) - (Policy brand value to)))) - - (def: .public (delegation downgrade upgrade) - (All (_ brand from to) - (-> (Can_Downgrade brand from) (Can_Upgrade brand to) - (Delegation brand from to))) - (|>> downgrade upgrade)) - - (type: .public (Context brand scope label) - (-> (Privilege brand label) - (scope label))) - - (def: privilege - Privilege - [#can_upgrade (|>> :abstraction) - #can_downgrade (|>> :representation)]) - - (def: .public (with_policy context) - (All (_ brand scope) - (Ex (_ label) - (-> (Context brand scope label) - (scope label)))) - (context ..privilege)) - - (def: (of_policy constructor) - (-> Type Type) - (type (All (_ brand label) - (constructor (All (_ value) (Policy brand value label)))))) - - (implementation: .public functor - (:~ (..of_policy Functor)) - - (def: (each f fa) - (|> fa :representation f :abstraction))) - - (implementation: .public apply - (:~ (..of_policy Apply)) - - (def: &functor ..functor) - - (def: (on fa ff) - (:abstraction ((:representation ff) (:representation fa))))) - - (implementation: .public monad - (:~ (..of_policy Monad)) - - (def: &functor ..functor) - (def: in (|>> :abstraction)) - (def: conjoint (|>> :representation))) + [(type: .public (Can_Upgrade brand label value) + (-> value (Policy brand value label))) + + (type: .public (Can_Downgrade brand label value) + (-> (Policy brand value label) value)) + + (type: .public (Privilege brand label) + (Record + [#can_upgrade (Can_Upgrade brand label) + #can_downgrade (Can_Downgrade brand label)])) + + (type: .public (Delegation brand from to) + (All (_ value) + (-> (Policy brand value from) + (Policy brand value to)))) + + (def: .public (delegation downgrade upgrade) + (All (_ brand from to) + (-> (Can_Downgrade brand from) (Can_Upgrade brand to) + (Delegation brand from to))) + (|>> downgrade upgrade)) + + (type: .public (Context brand scope label) + (-> (Privilege brand label) + (scope label))) + + (def: privilege + Privilege + [#can_upgrade (|>> :abstraction) + #can_downgrade (|>> :representation)]) + + (def: .public (with_policy context) + (All (_ brand scope) + (Ex (_ label) + (-> (Context brand scope label) + (scope label)))) + (context ..privilege)) + + (def: (of_policy constructor) + (-> Type Type) + (type (All (_ brand label) + (constructor (All (_ value) (Policy brand value label)))))) + + (implementation: .public functor + (:~ (..of_policy Functor)) + + (def: (each f fa) + (|> fa :representation f :abstraction))) + + (implementation: .public apply + (:~ (..of_policy Apply)) + + (def: &functor ..functor) + + (def: (on fa ff) + (:abstraction ((:representation ff) (:representation fa))))) + + (implementation: .public monad + (:~ (..of_policy Monad)) + + (def: &functor ..functor) + (def: in (|>> :abstraction)) + (def: conjoint (|>> :representation)))] ) (template [<brand> <value> <upgrade> <downgrade>] [(abstract: .public <brand> - {} - Any - (type: .public <value> - (Policy <brand>)) - - (type: .public <upgrade> - (Can_Upgrade <brand>)) - - (type: .public <downgrade> - (Can_Downgrade <brand>)) + [(type: .public <value> + (Policy <brand>)) + + (type: .public <upgrade> + (Can_Upgrade <brand>)) + + (type: .public <downgrade> + (Can_Downgrade <brand>))] )] [Privacy Private Can_Conceal Can_Reveal] |