diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/program/aedifex/metadata/artifact.lux | 18 | ||||
-rw-r--r-- | stdlib/source/program/aedifex/metadata/snapshot.lux | 11 |
2 files changed, 9 insertions, 20 deletions
diff --git a/stdlib/source/program/aedifex/metadata/artifact.lux b/stdlib/source/program/aedifex/metadata/artifact.lux index 7150efbab..50f228e50 100644 --- a/stdlib/source/program/aedifex/metadata/artifact.lux +++ b/stdlib/source/program/aedifex/metadata/artifact.lux @@ -105,15 +105,10 @@ (list (..format_versions (get@ #versions value)) (..format_last_updated (get@ #last_updated value))))))) -(def: (sub tag parser) - (All [a] (-> xml.Tag (Parser a) (Parser a))) - (do <>.monad - [_ (<xml>.node tag)] - (<xml>.children parser))) - (def: (text tag) (-> xml.Tag (Parser Text)) - (..sub tag <xml>.text)) + (<| (<xml>.node tag) + <xml>.text)) (def: date_parser (<text>.Parser Date) @@ -147,18 +142,17 @@ (def: #export parser (Parser Metadata) - (<| (..sub ..<metadata>) + (<| (<xml>.node ..<metadata>) ($_ <>.and (<xml>.somewhere (..text ..<group>)) (<xml>.somewhere (..text ..<name>)) - (<| (..sub ..<versioning>) + (<| (<xml>.node ..<versioning>) ($_ <>.and (<| <xml>.somewhere - (..sub ..<versions>) + (<xml>.node ..<versions>) (<>.many (..text ..<version>))) (<xml>.somewhere ..last_updated_parser) - )) - ))) + ))))) (def: #export equivalence (Equivalence Metadata) diff --git a/stdlib/source/program/aedifex/metadata/snapshot.lux b/stdlib/source/program/aedifex/metadata/snapshot.lux index 518e0404a..41a0d9986 100644 --- a/stdlib/source/program/aedifex/metadata/snapshot.lux +++ b/stdlib/source/program/aedifex/metadata/snapshot.lux @@ -77,19 +77,14 @@ (..format_version version) (///artifact/versioning.format versioning))))) -(def: (sub tag parser) - (All [a] (-> xml.Tag (Parser a) (Parser a))) - (do <>.monad - [_ (<xml>.node tag)] - (<xml>.children parser))) - (def: (text tag) (-> xml.Tag (Parser Text)) - (..sub tag <xml>.text)) + (<| (<xml>.node tag) + <xml>.text)) (def: #export parser (Parser Metadata) - (<| (..sub ..<metadata>) + (<| (<xml>.node ..<metadata>) (do {! <>.monad} [group (<xml>.somewhere (..text ..<group>)) name (<xml>.somewhere (..text ..<name>)) |