aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program/aedifex/metadata/artifact.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/program/aedifex/metadata/artifact.lux')
-rw-r--r--stdlib/source/program/aedifex/metadata/artifact.lux36
1 files changed, 18 insertions, 18 deletions
diff --git a/stdlib/source/program/aedifex/metadata/artifact.lux b/stdlib/source/program/aedifex/metadata/artifact.lux
index 0057ce119..01271437e 100644
--- a/stdlib/source/program/aedifex/metadata/artifact.lux
+++ b/stdlib/source/program/aedifex/metadata/artifact.lux
@@ -45,32 +45,32 @@
#versions (List Version)
#last_updated Instant]))
-(def: (pad value)
+(def (pad value)
(-> Nat Text)
(if (n.< 10 value)
(%.format "0" (%.nat value))
(%.nat value)))
-(def: (date_format value)
+(def (date_format value)
(%.Format Date)
(%.format (|> value date.year year.value .nat %.nat)
(|> value date.month month.number ..pad)
(|> value date.day_of_month ..pad)))
-(def: (time_format value)
+(def (time_format value)
(%.Format Time)
(let [(open "[0]") (time.clock value)]
(%.format (..pad #hour)
(..pad #minute)
(..pad #second))))
-(def: (instant_format value)
+(def (instant_format value)
(%.Format Instant)
(%.format (..date_format (instant.date value))
(..time_format (instant.time value))))
(with_template [<definition> <tag>]
- [(def: <definition> xml.Tag ["" <tag>])]
+ [(def <definition> xml.Tag ["" <tag>])]
[<group> "groupId"]
[<name> "artifactId"]
@@ -82,7 +82,7 @@
)
(with_template [<name> <type> <tag> <pre>]
- [(def: <name>
+ [(def <name>
(-> <type> XML)
(|>> <pre> {xml.#Text} list {xml.#Node <tag> xml.attributes}))]
@@ -92,11 +92,11 @@
[last_updated_format Instant ..<last_updated> ..instant_format]
)
-(def: versions_format
+(def versions_format
(-> (List Version) XML)
(|>> (list#each ..version_format) {xml.#Node ..<versions> xml.attributes}))
-(def: .public (format value)
+(def .public (format value)
(-> Metadata XML)
{xml.#Node ..<metadata>
xml.attributes
@@ -107,12 +107,12 @@
(list (..versions_format (the #versions value))
(..last_updated_format (the #last_updated value)))})})
-(def: (text tag)
+(def (text tag)
(-> xml.Tag (Parser Text))
(<| (<xml>.node tag)
<xml>.text))
-(def: date_parser
+(def date_parser
(<text>.Parser Date)
(do <>.monad
[year (<>.codec n.decimal (<text>.exactly 4 <text>.decimal))
@@ -122,7 +122,7 @@
day_of_month (<>.codec n.decimal (<text>.exactly 2 <text>.decimal))]
(<>.lifted (date.date year month day_of_month))))
-(def: time_parser
+(def time_parser
(<text>.Parser Time)
(do <>.monad
[hour (<>.codec n.decimal (<text>.exactly 2 <text>.decimal))
@@ -134,7 +134,7 @@
time.#second second
time.#milli_second 0]))))
-(def: last_updated_parser
+(def last_updated_parser
(Parser Instant)
(<text>.then (do <>.monad
[date ..date_parser
@@ -142,7 +142,7 @@
(in (instant.of_date_time date time)))
(..text ..<last_updated>)))
-(def: .public parser
+(def .public parser
(Parser Metadata)
(<| (<xml>.node ..<metadata>)
(all <>.and
@@ -158,7 +158,7 @@
(<xml>.somewhere ..last_updated_parser)
)))))
-(def: .public equivalence
+(def .public equivalence
(Equivalence Metadata)
(all product.equivalence
text.equivalence
@@ -167,15 +167,15 @@
instant.equivalence
))
-(def: .public uri
+(def .public uri
(-> Artifact URI)
//.remote_project_uri)
-(def: epoch
+(def epoch
Instant
(instant.of_millis +0))
-(def: .public (read repository artifact)
+(def .public (read repository artifact)
(-> (Repository Async) Artifact (Async (Try Metadata)))
(do async.monad
[project (at repository download (..uri artifact))]
@@ -195,7 +195,7 @@
..#versions (list)
..#last_updated ..epoch])}))))
-(def: .public (write repository artifact metadata)
+(def .public (write repository artifact metadata)
(-> (Repository Async) Artifact Metadata (Async (Try Any)))
(|> metadata
..format