diff options
author | Eduardo Julian | 2021-08-24 05:23:45 -0400 |
---|---|---|
committer | Eduardo Julian | 2021-08-24 05:23:45 -0400 |
commit | 36303d6cb2ce3ab9e36d045b9516c997bd461862 (patch) | |
tree | b9d2f1495143054d61d9af129f36833624db9dac /stdlib/source/library/lux/control/security | |
parent | ec1f31b5a1492d5e0ab260397291d4449483bbd9 (diff) |
Outsourced the syntax for labelled type definitions to macros.
Diffstat (limited to 'stdlib/source/library/lux/control/security')
-rw-r--r-- | stdlib/source/library/lux/control/security/capability.lux | 4 | ||||
-rw-r--r-- | stdlib/source/library/lux/control/security/policy.lux | 9 |
2 files changed, 7 insertions, 6 deletions
diff --git a/stdlib/source/library/lux/control/security/capability.lux b/stdlib/source/library/lux/control/security/capability.lux index 45b2bd083..ec84db916 100644 --- a/stdlib/source/library/lux/control/security/capability.lux +++ b/stdlib/source/library/lux/control/security/capability.lux @@ -51,14 +51,14 @@ (do {! meta.monad} [this_module meta.current_module_name .let [[name vars] declaration] - g!brand (\ ! map (|>> %.code code.text) + g!brand (\ ! each (|>> %.code code.text) (macro.identifier (format (%.name [this_module name])))) .let [capability (` (..Capability (.primitive (~ g!brand)) (~ input) (~ output)))]] (in (list (` (type: (~ export_policy) (~ (|declaration|.format declaration)) (~ capability))) (` (def: (~ (code.local_identifier forger)) - (All [(~+ (list\map code.local_identifier vars))] + (All [(~+ (list\each code.local_identifier vars))] (-> (-> (~ input) (~ output)) (~ capability))) (~! ..capability))) diff --git a/stdlib/source/library/lux/control/security/policy.lux b/stdlib/source/library/lux/control/security/policy.lux index 497e250ff..1087cf751 100644 --- a/stdlib/source/library/lux/control/security/policy.lux +++ b/stdlib/source/library/lux/control/security/policy.lux @@ -20,8 +20,9 @@ (-> (Policy brand value label) value)) (type: .public (Privilege brand label) - {#can_upgrade (Can_Upgrade brand label) - #can_downgrade (Can_Downgrade brand label)}) + (Record + {#can_upgrade (Can_Upgrade brand label) + #can_downgrade (Can_Downgrade brand label)})) (type: .public (Delegation brand from to) (All [value] @@ -58,7 +59,7 @@ (implementation: .public functor (:~ (..of_policy Functor)) - (def: (map f fa) + (def: (each f fa) (|> fa :representation f :abstraction))) (implementation: .public apply @@ -74,7 +75,7 @@ (def: &functor ..functor) (def: in (|>> :abstraction)) - (def: join (|>> :representation))) + (def: conjoint (|>> :representation))) ) (template [<brand> <value> <upgrade> <downgrade>] |