aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program
diff options
context:
space:
mode:
authorEduardo Julian2020-10-12 01:04:47 -0400
committerEduardo Julian2020-10-12 01:04:47 -0400
commit5b222d040ee361dd4022e88488a6bcef3ca40a71 (patch)
tree5506748e0aeaeead13ef40e0be2932f5c5c6a3ab /stdlib/source/program
parentbefa21cea76282f8cd3509e0a7da1bdffd353101 (diff)
Tweaked how I64 masks are made.
Diffstat (limited to 'stdlib/source/program')
-rw-r--r--stdlib/source/program/aedifex/project.lux27
1 files changed, 19 insertions, 8 deletions
diff --git a/stdlib/source/program/aedifex/project.lux b/stdlib/source/program/aedifex/project.lux
index 15abd9ee1..071f54b12 100644
--- a/stdlib/source/program/aedifex/project.lux
+++ b/stdlib/source/program/aedifex/project.lux
@@ -1,8 +1,9 @@
(.module:
[lux (#- Name)
[abstract
- ["." monad (#+ do)]
- ["." equivalence (#+ Equivalence)]]
+ [equivalence (#+ Equivalence)]
+ [monoid (#+ Monoid)]
+ ["." monad (#+ do)]]
[control
["." try (#+ Try)]
["." exception (#+ exception:)]]
@@ -19,13 +20,23 @@
(type: #export Project
(Dictionary Name Profile))
-(def: #export empty
- (dictionary.from-list text.hash (list [//.default (:: //.monoid identity)])))
+(def: #export (project name profile)
+ (-> Name Profile Project)
+ (dictionary.from-list text.hash (list [name profile])))
(def: #export equivalence
(Equivalence Project)
(dictionary.equivalence //.equivalence))
+(structure: #export monoid
+ (Monoid Project)
+
+ (def: identity
+ (dictionary.new text.hash))
+
+ (def: compose
+ (dictionary.merge-with (:: //.monoid compose))))
+
(exception: #export (unknown-profile {name Name})
(exception.report
["Name" (%.text name)]))
@@ -50,12 +61,12 @@
(get@ #//.parents profile))]
(wrap (list@fold (function (_ parent child)
(:: //.monoid compose child parent))
- profile
+ (set@ #//.parents (list) profile)
parents))))
#.None
(exception.throw ..unknown-profile [name])))
-(def: #export (profile project name)
- (-> Project Name (Try Profile))
- (profile' (set.new text.hash) project name))
+(def: #export (profile name project)
+ (-> Name Project (Try Profile))
+ (..profile' (set.new text.hash) project name))