(.module: [lux #* [abstract [equivalence (#+ Equivalence)]] [control ["." try (#+ Try) ("#\." functor)] [parser ["<.>" xml]]] [data ["." sum] ["." product] ["." binary (#+ Binary)] [format ["." xml (#+ XML)]] [collection [set (#+ Set)]]]] ["." // #_ ["/" profile] ["#." hash (#+ Hash SHA-1 MD5)] ["#." pom] [dependency (#+ Dependency) ["#." status (#+ Status)]] [repository ["#." origin (#+ Origin)]]]) (type: #export Package {#origin Origin #library [Binary Status] #pom [XML Status]}) (template [ ] [(def: #export ( package) (-> Package Bit) (case (get@ #origin package) ( _) true _ false))] [local? #//origin.Local] [remote? #//origin.Remote] ) (def: #export (local pom library) (-> XML Binary Package) {#origin (#//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) ))