diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/program/aedifex/profile.lux | 89 |
1 files changed, 86 insertions, 3 deletions
diff --git a/stdlib/source/program/aedifex/profile.lux b/stdlib/source/program/aedifex/profile.lux index 5e5cb6175..02ae69ac8 100644 --- a/stdlib/source/program/aedifex/profile.lux +++ b/stdlib/source/program/aedifex/profile.lux @@ -1,7 +1,8 @@ (.module: [lux (#- Info Source Module Name) [abstract - [monoid (#+ Monoid)]] + [monoid (#+ Monoid)] + ["." equivalence (#+ Equivalence)]] [control ["." exception (#+ exception:)]] [data @@ -20,7 +21,7 @@ [archive [descriptor (#+ Module)]]]]]] [// - [artifact (#+ Artifact)] + ["." artifact (#+ Artifact)] ["." dependency]]) (def: #export file @@ -30,11 +31,32 @@ #Repo #Manual) +(structure: distribution-equivalence + (Equivalence Distribution) + + (def: (= reference subject) + (case [reference subject] + (^template [<tag>] + [<tag> <tag>] + true) + ([#Repo] + [#Manual]) + + _ + false))) + (type: #export License [Text URL Distribution]) +(def: license-equivalence + (Equivalence License) + ($_ equivalence.product + text.equivalence + text.equivalence + ..distribution-equivalence)) + (type: #export SCM URL) @@ -42,6 +64,12 @@ [Text URL]) +(def: organization-equivalence + (Equivalence Organization) + ($_ equivalence.product + text.equivalence + text.equivalence)) + (type: #export Email Text) @@ -50,6 +78,13 @@ Email (Maybe Organization)]) +(def: developer-equivalence + (Equivalence Developer) + ($_ equivalence.product + text.equivalence + text.equivalence + (maybe.equivalence ..organization-equivalence))) + (type: #export Contributor Developer) @@ -62,6 +97,17 @@ #developers (List Developer) #contributors (List Contributor)}) +(def: info-equivalence + (Equivalence Info) + ($_ equivalence.product + (maybe.equivalence text.equivalence) + (maybe.equivalence text.equivalence) + (maybe.equivalence text.equivalence) + (list.equivalence ..license-equivalence) + (maybe.equivalence ..organization-equivalence) + (list.equivalence ..developer-equivalence) + (list.equivalence ..developer-equivalence))) + (def: #export default-info Info {#url #.None @@ -105,7 +151,42 @@ #test (Maybe Module) #deploy-repositories (Dictionary Text dependency.Repository)}) -(exception: #export no-identity) +(def: #export empty + Profile + {#parents (list) + #identity #.None + #info #.None + #repositories (set.new text.hash) + #dependencies (set.new dependency.hash) + #sources (set.new text.hash) + #target #.None + #program #.None + #test #.None + #deploy-repositories (dictionary.new text.hash)}) + +(def: #export equivalence + (Equivalence Profile) + ($_ equivalence.product + ## #parents + (list.equivalence text.equivalence) + ## #identity + (maybe.equivalence artifact.equivalence) + ## #info + (maybe.equivalence ..info-equivalence) + ## #repositories + set.equivalence + ## #dependencies + set.equivalence + ## #sources + set.equivalence + ## #target + (maybe.equivalence text.equivalence) + ## #program + (maybe.equivalence text.equivalence) + ## #test + (maybe.equivalence text.equivalence) + ## #deploy-repositories + (dictionary.equivalence text.equivalence))) (structure: #export monoid (Monoid Profile) @@ -133,3 +214,5 @@ #program (maybe@compose (get@ #program override) (get@ #program baseline)) #test (maybe@compose (get@ #test override) (get@ #test baseline)) #deploy-repositories (dictionary.merge (get@ #deploy-repositories override) (get@ #deploy-repositories baseline))})) + +(exception: #export no-identity) |