(.using [library [lux {"-" local} [abstract [equivalence {"+" Equivalence}]] [control ["[0]" try {"+" Try} ("[1]#[0]" functor)] [parser ["<[0]>" xml]]] [data ["[0]" sum] ["[0]" product] ["[0]" binary {"+" Binary}] [text [encoding ["[0]" utf8]]] [format ["[0]" xml {"+" XML}]] [collection [set {"+" Set}]]]]] ["[0]" // "_" ["/" profile] ["[1][0]" hash] ["[1][0]" pom] [dependency {"+" Dependency} ["[1][0]" status {"+" Status}]] [repository [remote {"+" Address}] ["[1][0]" origin {"+" Origin}]]]) (type: .public Package (Record [#origin Origin #library [Binary Status] #pom [XML Binary Status]])) (template [ ] [(def: .public ( package) (-> Package Bit) (case (the #origin package) { _} true _ false))] [local? //origin.#Local] [remote? //origin.#Remote] ) (def: .public (local pom library) (-> XML Binary Package) [#origin {//origin.#Local ""} #library [library {//status.#Verified (//hash.sha-1 library) (//hash.md5 library)}] #pom (let [binary_pom (|> pom (# xml.codec encoded) (# utf8.codec encoded))] [pom binary_pom {//status.#Verified (//hash.sha-1 binary_pom) (//hash.md5 binary_pom)}])]) (def: .public dependencies (-> Package (Try (Set Dependency))) (|>> (the #pom) product.left list (.result //pom.parser) (try#each (the /.#dependencies)))) (def: .public repositories (-> Package (Try (Set Address))) (|>> (the #pom) product.left list (.result //pom.parser) (try#each (the /.#repositories)))) (def: .public equivalence (Equivalence Package) ($_ product.equivalence //origin.equivalence ($_ product.equivalence binary.equivalence //status.equivalence) ($_ product.equivalence xml.equivalence binary.equivalence //status.equivalence) ))