(.module: [lux #* [abstract [equivalence (#+ Equivalence)]] [control ["." try (#+ Try) ("#\." functor)] [parser ["<.>" xml]]] [data ["." sum] ["." product] ["." binary (#+ Binary)] [format ["." xml (#+ XML)]] [collection [set (#+ Set)]]]] ["." // #_ [dependency (#+ Dependency) ["#." status (#+ Status)]] ["/" profile] ["#." hash (#+ Hash SHA-1 MD5)] ["#." pom]]) (type: #export Origin #Local #Remote) (structure: any_equivalence (Equivalence Any) (def: (= _ _) true)) (def: origin_equivalence (Equivalence Origin) ($_ sum.equivalence ..any_equivalence ..any_equivalence )) (type: #export Package {#origin Origin #library [Binary Status] #pom [XML Status]}) (template [ ] [(def: #export (-> Package Bit) (|>> (get@ #origin) (\ ..origin_equivalence = )))] [local? #Local] [remote? #Remote] ) (def: #export (local pom library) (-> XML Binary Package) {#origin #Local #library [library #//status.Unverified] #pom [pom #//status.Unverified]}) (def: #export dependencies (-> Package (Try (Set Dependency))) (|>> (get@ #pom) product.left (.run //pom.parser) (try\map (get@ #/.dependencies)))) (def: #export equivalence (Equivalence Package) ($_ product.equivalence ..origin_equivalence (product.equivalence binary.equivalence //status.equivalence) (product.equivalence xml.equivalence //status.equivalence) ))