aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program/aedifex
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/program/aedifex')
-rw-r--r--stdlib/source/program/aedifex/artifact.lux7
-rw-r--r--stdlib/source/program/aedifex/artifact/snapshot.lux5
-rw-r--r--stdlib/source/program/aedifex/artifact/snapshot/stamp.lux5
-rw-r--r--stdlib/source/program/aedifex/artifact/snapshot/version.lux7
-rw-r--r--stdlib/source/program/aedifex/artifact/snapshot/version/value.lux5
-rw-r--r--stdlib/source/program/aedifex/artifact/time/date.lux8
-rw-r--r--stdlib/source/program/aedifex/artifact/versioning.lux7
-rw-r--r--stdlib/source/program/aedifex/cli.lux46
-rw-r--r--stdlib/source/program/aedifex/command/build.lux11
-rw-r--r--stdlib/source/program/aedifex/dependency.lux5
-rw-r--r--stdlib/source/program/aedifex/dependency/status.lux9
-rw-r--r--stdlib/source/program/aedifex/input.lux26
-rw-r--r--stdlib/source/program/aedifex/metadata/artifact.lux9
-rw-r--r--stdlib/source/program/aedifex/metadata/snapshot.lux5
-rw-r--r--stdlib/source/program/aedifex/package.lux7
-rw-r--r--stdlib/source/program/aedifex/profile.lux53
-rw-r--r--stdlib/source/program/aedifex/project.lux6
-rw-r--r--stdlib/source/program/aedifex/repository/identity.lux5
-rw-r--r--stdlib/source/program/aedifex/repository/origin.lux5
-rw-r--r--stdlib/source/program/aedifex/runtime.lux5
20 files changed, 133 insertions, 103 deletions
diff --git a/stdlib/source/program/aedifex/artifact.lux b/stdlib/source/program/aedifex/artifact.lux
index 8aca29ea0..9645ba1f8 100644
--- a/stdlib/source/program/aedifex/artifact.lux
+++ b/stdlib/source/program/aedifex/artifact.lux
@@ -26,9 +26,10 @@
Text)
(type: .public Artifact
- {#group Group
- #name Name
- #version Version})
+ (Record
+ {#group Group
+ #name Name
+ #version Version}))
(def: .public hash
(Hash Artifact)
diff --git a/stdlib/source/program/aedifex/artifact/snapshot.lux b/stdlib/source/program/aedifex/artifact/snapshot.lux
index 133b6c4cc..936419788 100644
--- a/stdlib/source/program/aedifex/artifact/snapshot.lux
+++ b/stdlib/source/program/aedifex/artifact/snapshot.lux
@@ -16,8 +16,9 @@
["#." stamp (#+ Stamp)]])
(type: .public Snapshot
- #Local
- (#Remote Stamp))
+ (Variant
+ #Local
+ (#Remote Stamp)))
(implementation: any_equivalence
(Equivalence Any)
diff --git a/stdlib/source/program/aedifex/artifact/snapshot/stamp.lux b/stdlib/source/program/aedifex/artifact/snapshot/stamp.lux
index 609de1013..d8d1e6bbc 100644
--- a/stdlib/source/program/aedifex/artifact/snapshot/stamp.lux
+++ b/stdlib/source/program/aedifex/artifact/snapshot/stamp.lux
@@ -17,8 +17,9 @@
["#." build (#+ Build)]])
(type: .public Stamp
- {#time Time
- #build Build})
+ (Record
+ {#time Time
+ #build Build}))
(def: .public equivalence
(Equivalence Stamp)
diff --git a/stdlib/source/program/aedifex/artifact/snapshot/version.lux b/stdlib/source/program/aedifex/artifact/snapshot/version.lux
index 13f2b5692..aa2994958 100644
--- a/stdlib/source/program/aedifex/artifact/snapshot/version.lux
+++ b/stdlib/source/program/aedifex/artifact/snapshot/version.lux
@@ -18,9 +18,10 @@
["#." time (#+ Time)]])
(type: .public Version
- {#extension Type
- #value Text
- #updated Time})
+ (Record
+ {#extension Type
+ #value Text
+ #updated Time}))
(def: .public equivalence
(Equivalence Version)
diff --git a/stdlib/source/program/aedifex/artifact/snapshot/version/value.lux b/stdlib/source/program/aedifex/artifact/snapshot/version/value.lux
index 63681a3fe..cfcf3be09 100644
--- a/stdlib/source/program/aedifex/artifact/snapshot/version/value.lux
+++ b/stdlib/source/program/aedifex/artifact/snapshot/version/value.lux
@@ -12,8 +12,9 @@
["#." stamp]])
(type: .public Value
- {#version Text
- #snapshot Snapshot})
+ (Record
+ {#version Text
+ #snapshot Snapshot}))
(def: .public equivalence
(Equivalence Value)
diff --git a/stdlib/source/program/aedifex/artifact/time/date.lux b/stdlib/source/program/aedifex/artifact/time/date.lux
index c3c0b9cc1..ca309e382 100644
--- a/stdlib/source/program/aedifex/artifact/time/date.lux
+++ b/stdlib/source/program/aedifex/artifact/time/date.lux
@@ -50,10 +50,10 @@
(def: .public (date raw)
(-> date.Date (Try Date))
(let [year (|> raw date.year year.value)]
- (if (and (i.>= ..min_year year)
- (i.<= ..max_year year))
- (#try.Success (:abstraction raw))
- (exception.except ..year_is_out_of_range [(date.year raw)]))))
+ (if (or (i.< ..min_year year)
+ (i.> ..max_year year))
+ (exception.except ..year_is_out_of_range [(date.year raw)])
+ (#try.Success (:abstraction raw)))))
(def: .public value
(-> Date date.Date)
diff --git a/stdlib/source/program/aedifex/artifact/versioning.lux b/stdlib/source/program/aedifex/artifact/versioning.lux
index 886e89491..38001bfe2 100644
--- a/stdlib/source/program/aedifex/artifact/versioning.lux
+++ b/stdlib/source/program/aedifex/artifact/versioning.lux
@@ -30,9 +30,10 @@
["#/." version (#+ Version)]]])
(type: .public Versioning
- {#snapshot Snapshot
- #last_updated //time.Time
- #versions (List Version)})
+ (Record
+ {#snapshot Snapshot
+ #last_updated //time.Time
+ #versions (List Version)}))
(def: .public init
{#snapshot #//snapshot.Local
diff --git a/stdlib/source/program/aedifex/cli.lux b/stdlib/source/program/aedifex/cli.lux
index 87ad9938a..b51a0d1f1 100644
--- a/stdlib/source/program/aedifex/cli.lux
+++ b/stdlib/source/program/aedifex/cli.lux
@@ -2,7 +2,8 @@
[library
[lux (#- Name)
[abstract
- [equivalence (#+ Equivalence)]]
+ [equivalence (#+ Equivalence)]
+ [monad (#+ do)]]
[control
["<>" parser
["." cli (#+ Parser)]]]
@@ -16,8 +17,9 @@
["/" profile (#+ Name)]])
(type: .public Compilation
- #Build
- #Test)
+ (Variant
+ #Build
+ #Test))
(implementation: any_equivalence
(Equivalence Any)
@@ -36,14 +38,15 @@
(cli.this "test")))
(type: .public Command
- #Version
- #Clean
- #POM
- #Dependencies
- #Install
- (#Deploy Text Identity)
- (#Compilation Compilation)
- (#Auto Compilation))
+ (Variant
+ #Version
+ #Clean
+ #POM
+ #Dependencies
+ #Install
+ (#Deploy Text Identity)
+ (#Compilation Compilation)
+ (#Auto Compilation)))
(def: .public equivalence
(Equivalence Command)
@@ -86,12 +89,15 @@
))
(def: .public command
- (Parser [Name Command])
- ($_ <>.either
- (<>.after (cli.this "with")
- ($_ <>.and
- cli.any
- ..command'))
- (\ <>.monad each (|>> [/.default])
- ..command')
- ))
+ (Parser [(List Name) Command])
+ (<>.rec
+ (function (_ command)
+ ($_ <>.either
+ (<>.after (cli.this "with")
+ (do <>.monad
+ [head cli.any
+ [tail command] command]
+ (in [(#.Item head tail) command])))
+ (\ <>.monad each (|>> [(list /.default)])
+ ..command')
+ ))))
diff --git a/stdlib/source/program/aedifex/command/build.lux b/stdlib/source/program/aedifex/command/build.lux
index bf7c95870..ff4ace158 100644
--- a/stdlib/source/program/aedifex/command/build.lux
+++ b/stdlib/source/program/aedifex/command/build.lux
@@ -74,11 +74,12 @@
(exception: .public no_specified_program)
(type: .public Compiler
- (#JVM Dependency)
- (#JS Dependency)
- (#Python Dependency)
- (#Lua Dependency)
- (#Ruby Dependency))
+ (Variant
+ (#JVM Dependency)
+ (#JS Dependency)
+ (#Python Dependency)
+ (#Lua Dependency)
+ (#Ruby Dependency)))
(def: (remove_dependency dependency)
(-> Dependency (-> Resolution Resolution))
diff --git a/stdlib/source/program/aedifex/dependency.lux b/stdlib/source/program/aedifex/dependency.lux
index b1a23c0de..e1602990d 100644
--- a/stdlib/source/program/aedifex/dependency.lux
+++ b/stdlib/source/program/aedifex/dependency.lux
@@ -14,8 +14,9 @@
[type (#+ Type)]]])
(type: .public Dependency
- {#artifact Artifact
- #type Type})
+ (Record
+ {#artifact Artifact
+ #type Type}))
(def: .public hash
(Hash Dependency)
diff --git a/stdlib/source/program/aedifex/dependency/status.lux b/stdlib/source/program/aedifex/dependency/status.lux
index 2c2e13fd8..eac5c9fd0 100644
--- a/stdlib/source/program/aedifex/dependency/status.lux
+++ b/stdlib/source/program/aedifex/dependency/status.lux
@@ -11,10 +11,11 @@
["#." hash (#+ Hash SHA-1 MD5)]])
(type: .public Status
- #Unverified
- (#Partial (Either (Hash SHA-1)
- (Hash MD5)))
- (#Verified (Hash SHA-1) (Hash MD5)))
+ (Variant
+ #Unverified
+ (#Partial (Either (Hash SHA-1)
+ (Hash MD5)))
+ (#Verified (Hash SHA-1) (Hash MD5))))
(implementation: any_equivalence
(Equivalence Any)
diff --git a/stdlib/source/program/aedifex/input.lux b/stdlib/source/program/aedifex/input.lux
index 27591c709..43edc3404 100644
--- a/stdlib/source/program/aedifex/input.lux
+++ b/stdlib/source/program/aedifex/input.lux
@@ -1,8 +1,9 @@
(.module:
[library
- [lux #*
+ [lux (#- Name)
[abstract
- [monad (#+ Monad do)]]
+ ["." monad (#+ Monad do)]
+ ["." mix]]
[control
[pipe (#+ do>)]
["." try (#+ Try)]
@@ -12,7 +13,9 @@
[binary (#+ Binary)]
["." text
[encoding
- ["." utf8]]]]
+ ["." utf8]]]
+ [collection
+ ["." list]]]
[meta
["." location]]
[tool
@@ -23,7 +26,7 @@
[world
["." file]]]]
["." // #_
- [profile (#+ Profile)]
+ ["#." profile (#+ Name Profile)]
["#." project (#+ Project)]
["#." parser]])
@@ -46,11 +49,14 @@
[..lux_parser]
[(list) (<code>.result //parser.project)])))
-(def: .public (read monad fs profile)
- (All [!] (-> (Monad !) (file.System !) Text (! (Try Profile))))
+(def: .public (read monad fs profiles)
+ (All [!] (-> (Monad !) (file.System !) (List Name) (! (Try Profile))))
(|> //project.file
(\ fs read)
- (\ monad each (|>> (do> try.monad
- []
- [..project_parser]
- [(//project.profile profile)])))))
+ (\ monad each
+ (function (_ it)
+ (do {! try.monad}
+ [it it
+ it (..project_parser it)
+ it (monad.each ! (//project.profile it) profiles)]
+ (in (mix.with_monoid //profile.monoid list.mix it)))))))
diff --git a/stdlib/source/program/aedifex/metadata/artifact.lux b/stdlib/source/program/aedifex/metadata/artifact.lux
index 85fe747bd..3a6ffb74f 100644
--- a/stdlib/source/program/aedifex/metadata/artifact.lux
+++ b/stdlib/source/program/aedifex/metadata/artifact.lux
@@ -39,10 +39,11 @@
["#." artifact (#+ Group Name Version Artifact)]]])
(type: .public Metadata
- {#group Group
- #name Name
- #versions (List Version)
- #last_updated Instant})
+ (Record
+ {#group Group
+ #name Name
+ #versions (List Version)
+ #last_updated Instant}))
(def: (pad value)
(-> Nat Text)
diff --git a/stdlib/source/program/aedifex/metadata/snapshot.lux b/stdlib/source/program/aedifex/metadata/snapshot.lux
index 3a3464cd6..d5e9483bf 100644
--- a/stdlib/source/program/aedifex/metadata/snapshot.lux
+++ b/stdlib/source/program/aedifex/metadata/snapshot.lux
@@ -46,8 +46,9 @@
["#/." stamp]]]]])
(type: .public Metadata
- {#artifact Artifact
- #versioning Versioning})
+ (Record
+ {#artifact Artifact
+ #versioning Versioning}))
(template [<definition> <tag>]
[(def: <definition> xml.Tag ["" <tag>])]
diff --git a/stdlib/source/program/aedifex/package.lux b/stdlib/source/program/aedifex/package.lux
index 6a3a71f6d..49aa2867e 100644
--- a/stdlib/source/program/aedifex/package.lux
+++ b/stdlib/source/program/aedifex/package.lux
@@ -29,9 +29,10 @@
["#." origin (#+ Origin)]]])
(type: .public Package
- {#origin Origin
- #library [Binary Status]
- #pom [XML Binary Status]})
+ (Record
+ {#origin Origin
+ #library [Binary Status]
+ #pom [XML Binary Status]}))
(template [<name> <tag>]
[(def: .public (<name> package)
diff --git a/stdlib/source/program/aedifex/profile.lux b/stdlib/source/program/aedifex/profile.lux
index 264bc9015..b861e1601 100644
--- a/stdlib/source/program/aedifex/profile.lux
+++ b/stdlib/source/program/aedifex/profile.lux
@@ -38,8 +38,9 @@
#dependency.type type.jvm_library})
(type: .public Distribution
- #Repo
- #Manual)
+ (Variant
+ #Repo
+ #Manual))
(implementation: distribution_equivalence
(Equivalence Distribution)
@@ -99,13 +100,14 @@
Developer)
(type: .public Info
- {#url (Maybe URL)
- #scm (Maybe SCM)
- #description (Maybe Text)
- #licenses (List License)
- #organization (Maybe Organization)
- #developers (List Developer)
- #contributors (List Contributor)})
+ (Record
+ {#url (Maybe URL)
+ #scm (Maybe SCM)
+ #description (Maybe Text)
+ #licenses (List License)
+ #organization (Maybe Organization)
+ #developers (List Developer)
+ #contributors (List Contributor)}))
(def: info_equivalence
(Equivalence Info)
@@ -154,22 +156,23 @@
"")
(type: .public Profile
- {#parents (List Name)
- #identity (Maybe Artifact)
- #info (Maybe Info)
- #repositories (Set Address)
- #dependencies (Set Dependency)
- #compiler Dependency
- #sources (Set Source)
- #target Target
- #program (Maybe Module)
- #test (Maybe Module)
- #deploy_repositories (Dictionary Text Address)
- #java Runtime
- #js Runtime
- #python Runtime
- #lua Runtime
- #ruby Runtime})
+ (Record
+ {#parents (List Name)
+ #identity (Maybe Artifact)
+ #info (Maybe Info)
+ #repositories (Set Address)
+ #dependencies (Set Dependency)
+ #compiler Dependency
+ #sources (Set Source)
+ #target Target
+ #program (Maybe Module)
+ #test (Maybe Module)
+ #deploy_repositories (Dictionary Text Address)
+ #java Runtime
+ #js Runtime
+ #python Runtime
+ #lua Runtime
+ #ruby Runtime}))
(def: .public equivalence
(Equivalence Profile)
diff --git a/stdlib/source/program/aedifex/project.lux b/stdlib/source/program/aedifex/project.lux
index 4f6da6d62..581c899a7 100644
--- a/stdlib/source/program/aedifex/project.lux
+++ b/stdlib/source/program/aedifex/project.lux
@@ -71,6 +71,6 @@
#.None
(exception.except ..unknown_profile [name])))
-(def: .public (profile name project)
- (-> Name Project (Try Profile))
- (..profile' (set.empty text.hash) project name))
+(def: .public profile
+ (-> Project Name (Try Profile))
+ (..profile' (set.empty text.hash)))
diff --git a/stdlib/source/program/aedifex/repository/identity.lux b/stdlib/source/program/aedifex/repository/identity.lux
index 4201123c0..533b4fb4e 100644
--- a/stdlib/source/program/aedifex/repository/identity.lux
+++ b/stdlib/source/program/aedifex/repository/identity.lux
@@ -18,8 +18,9 @@
Text)
(type: .public Identity
- {#user User
- #password Password})
+ (Record
+ {#user User
+ #password Password}))
(def: .public equivalence
(Equivalence Identity)
diff --git a/stdlib/source/program/aedifex/repository/origin.lux b/stdlib/source/program/aedifex/repository/origin.lux
index b850bf21f..845592762 100644
--- a/stdlib/source/program/aedifex/repository/origin.lux
+++ b/stdlib/source/program/aedifex/repository/origin.lux
@@ -11,8 +11,9 @@
[net (#+ URL)]]]])
(type: .public Origin
- (#Local Path)
- (#Remote URL))
+ (Variant
+ (#Local Path)
+ (#Remote URL)))
(def: .public equivalence
(Equivalence Origin)
diff --git a/stdlib/source/program/aedifex/runtime.lux b/stdlib/source/program/aedifex/runtime.lux
index addfd4a52..bdf81da78 100644
--- a/stdlib/source/program/aedifex/runtime.lux
+++ b/stdlib/source/program/aedifex/runtime.lux
@@ -15,8 +15,9 @@
["." file]]]])
(type: .public Runtime
- {#program Text
- #parameters (List Text)})
+ (Record
+ {#program Text
+ #parameters (List Text)}))
(def: .public equivalence
(Equivalence Runtime)