(.module: [lux (#- Info Source Module Name) [abstract [monoid (#+ Monoid)] [equivalence (#+ Equivalence)]] [control ["." exception (#+ exception:)]] [data ["." product] ["." maybe ("#\." monoid)] ["." text ("#\." equivalence)] [collection ["." dictionary (#+ Dictionary)] ["." list ("#\." monoid)] ["." set (#+ Set)]]] [world [net (#+ URL)] [file (#+ Path)]] [tool [compiler [meta [archive [descriptor (#+ Module)]]]]]] [// ["." artifact (#+ Artifact)] ["." dependency] [repository [remote (#+ Address)]]]) (type: #export Distribution #Repo #Manual) (implementation: distribution_equivalence (Equivalence Distribution) (def: (= reference subject) (case [reference subject] (^template [] [[ ] true]) ([#Repo] [#Manual]) _ false))) (type: #export License [Text URL Distribution]) (def: license_equivalence (Equivalence License) ($_ product.equivalence text.equivalence text.equivalence ..distribution_equivalence)) (type: #export SCM URL) (type: #export Organization [Text URL]) (def: organization_equivalence (Equivalence Organization) ($_ product.equivalence text.equivalence text.equivalence)) (type: #export Email Text) (type: #export Developer [Text Email (Maybe Organization)]) (def: developer_equivalence (Equivalence Developer) ($_ product.equivalence text.equivalence text.equivalence (maybe.equivalence ..organization_equivalence))) (type: #export Contributor Developer) (type: #export Info {#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) ($_ product.equivalence (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 #scm #.None #description #.None #licenses (list) #organization #.None #developers (list) #contributors (list)}) (type: #export Source Path) (def: #export default_source Source "source") (type: #export Target Path) (def: #export default_target Target "target") (def: #export default_repository Address "https://repo1.maven.org/maven2/") (type: #export Name Text) (def: #export default Name "") (type: #export Profile {#parents (List Name) #identity (Maybe Artifact) #info (Maybe Info) #repositories (Set Address) #dependencies (Set dependency.Dependency) #sources (Set Source) #target Target #program (Maybe Module) #test (Maybe Module) #deploy_repositories (Dictionary Text Address)}) (def: #export equivalence (Equivalence Profile) ($_ product.equivalence ## #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 text.equivalence ## #program (maybe.equivalence text.equivalence) ## #test (maybe.equivalence text.equivalence) ## #deploy_repositories (dictionary.equivalence text.equivalence))) (implementation: #export monoid (Monoid Profile) (def: identity {#parents (list) #identity #.None #info #.None #repositories (set.new text.hash) #dependencies (set.new dependency.hash) #sources (set.new text.hash) #target ..default_target #program #.None #test #.None #deploy_repositories (dictionary.new text.hash)}) (def: (compose override baseline) {#parents (list\compose (get@ #parents baseline) (get@ #parents override)) #identity (maybe\compose (get@ #identity override) (get@ #identity baseline)) #info (maybe\compose (get@ #info override) (get@ #info baseline)) #repositories (set.union (get@ #repositories baseline) (get@ #repositories override)) #dependencies (set.union (get@ #dependencies baseline) (get@ #dependencies override)) #sources (set.union (get@ #sources baseline) (get@ #sources override)) #target (if (text\= ..default_target (get@ #target baseline)) (get@ #target override) (get@ #target baseline)) #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)