diff options
author | Eduardo Julian | 2021-08-08 17:56:15 -0400 |
---|---|---|
committer | Eduardo Julian | 2021-08-08 17:56:15 -0400 |
commit | f621a133e6e0a516c0586270fea8eaffb4829d82 (patch) | |
tree | 399396ee2f6a10df10cea9b78c51c76679b70e59 /stdlib/source/program/aedifex/artifact | |
parent | 17e7566be51df5e428a6b10e6469201a8a9468da (diff) |
No more #export magic syntax.
Diffstat (limited to 'stdlib/source/program/aedifex/artifact')
12 files changed, 56 insertions, 54 deletions
diff --git a/stdlib/source/program/aedifex/artifact/extension.lux b/stdlib/source/program/aedifex/artifact/extension.lux index d1102437d..11a94bb7e 100644 --- a/stdlib/source/program/aedifex/artifact/extension.lux +++ b/stdlib/source/program/aedifex/artifact/extension.lux @@ -9,22 +9,22 @@ ["." // #_ ["#" type]]) -(type: #export Extension +(type: .public Extension Text) (def: separator ".") -(def: #export extension +(def: .public extension (-> //.Type Extension) (|>> (format ..separator))) -(def: #export type +(def: .public type (-> Extension //.Type) (text.replace_all ..separator "")) (template [<name>] - [(def: #export <name> + [(def: .public <name> Extension (..extension (template.identifier [//._] [<name>])))] diff --git a/stdlib/source/program/aedifex/artifact/snapshot.lux b/stdlib/source/program/aedifex/artifact/snapshot.lux index 6a5849f43..133b6c4cc 100644 --- a/stdlib/source/program/aedifex/artifact/snapshot.lux +++ b/stdlib/source/program/aedifex/artifact/snapshot.lux @@ -15,7 +15,7 @@ ["." / #_ ["#." stamp (#+ Stamp)]]) -(type: #export Snapshot +(type: .public Snapshot #Local (#Remote Stamp)) @@ -25,7 +25,7 @@ (def: (= _ _) true)) -(def: #export equivalence +(def: .public equivalence (Equivalence Snapshot) ($_ sum.equivalence ..any_equivalence @@ -54,7 +54,7 @@ (<text>.then (<text>.this ..local_copy_value)) <xml>.text)) -(def: #export (format snapshot) +(def: .public (format snapshot) (-> Snapshot XML) (<| (#xml.Node ..<snapshot> xml.attributes) (case snapshot @@ -64,7 +64,7 @@ (#Remote stamp) (/stamp.format stamp)))) -(def: #export parser +(def: .public parser (Parser Snapshot) (<| (<xml>.node <snapshot>) (<>.or ..local_copy_parser diff --git a/stdlib/source/program/aedifex/artifact/snapshot/build.lux b/stdlib/source/program/aedifex/artifact/snapshot/build.lux index 37bb3ca2d..15d0c91dd 100644 --- a/stdlib/source/program/aedifex/artifact/snapshot/build.lux +++ b/stdlib/source/program/aedifex/artifact/snapshot/build.lux @@ -17,10 +17,10 @@ [number ["." nat]]]]]) -(type: #export Build +(type: .public Build Nat) -(def: #export equivalence +(def: .public equivalence (Equivalence Build) nat.equivalence) @@ -28,14 +28,14 @@ xml.Tag ["" "buildNumber"]) -(def: #export format +(def: .public format (-> Build XML) (|>> %.nat #xml.Text list (#xml.Node ..tag xml.attributes))) -(def: #export parser +(def: .public parser (Parser Build) (<| (<xml>.node ..tag) (<text>.then (<>.codec nat.decimal (<text>.many <text>.decimal))) diff --git a/stdlib/source/program/aedifex/artifact/snapshot/stamp.lux b/stdlib/source/program/aedifex/artifact/snapshot/stamp.lux index 0e9cba494..609de1013 100644 --- a/stdlib/source/program/aedifex/artifact/snapshot/stamp.lux +++ b/stdlib/source/program/aedifex/artifact/snapshot/stamp.lux @@ -16,11 +16,11 @@ ["#." time (#+ Time)] ["#." build (#+ Build)]]) -(type: #export Stamp +(type: .public Stamp {#time Time #build Build}) -(def: #export equivalence +(def: .public equivalence (Equivalence Stamp) ($_ product.equivalence //time.equivalence @@ -38,7 +38,7 @@ list (#xml.Node ..<timestamp> xml.attributes))) -(def: #export (format (^slots [#time #build])) +(def: .public (format (^slots [#time #build])) (-> Stamp (List XML)) (list (..time_format time) (//build.format build))) @@ -49,7 +49,7 @@ (<text>.then //time.parser) <xml>.text)) -(def: #export parser +(def: .public parser (Parser Stamp) (<>.and (<xml>.somewhere ..time_parser) (<xml>.somewhere //build.parser))) diff --git a/stdlib/source/program/aedifex/artifact/snapshot/time.lux b/stdlib/source/program/aedifex/artifact/snapshot/time.lux index 08f8b8035..703354eb8 100644 --- a/stdlib/source/program/aedifex/artifact/snapshot/time.lux +++ b/stdlib/source/program/aedifex/artifact/snapshot/time.lux @@ -21,23 +21,23 @@ ["#/." date] ["#/." time]]]) -(type: #export Time +(type: .public Time ///time.Time) -(def: #export equivalence +(def: .public equivalence (Equivalence Time) ///time.equivalence) (def: separator ".") -(def: #export (format [date time]) +(def: .public (format [date time]) (%.Format Time) (%.format (///time/date.format date) ..separator (///time/time.format time))) -(def: #export parser +(def: .public parser (<text>.Parser Time) (do <>.monad [date ///time/date.parser diff --git a/stdlib/source/program/aedifex/artifact/snapshot/version.lux b/stdlib/source/program/aedifex/artifact/snapshot/version.lux index c1341cf98..13f2b5692 100644 --- a/stdlib/source/program/aedifex/artifact/snapshot/version.lux +++ b/stdlib/source/program/aedifex/artifact/snapshot/version.lux @@ -17,12 +17,12 @@ ["#." type (#+ Type)] ["#." time (#+ Time)]]) -(type: #export Version +(type: .public Version {#extension Type #value Text #updated Time}) -(def: #export equivalence +(def: .public equivalence (Equivalence Version) ($_ product.equivalence text.equivalence @@ -44,7 +44,7 @@ (-> xml.Tag Text XML) (|> value #xml.Text list (#xml.Node tag xml.attributes))) -(def: #export (format (^slots [#extension #value #updated])) +(def: .public (format (^slots [#extension #value #updated])) (-> Version XML) (<| (#xml.Node ..<snapshot_version> xml.attributes) (list (..text_format ..<extension> extension) @@ -56,7 +56,7 @@ (<| (<xml>.node tag) <xml>.text)) -(def: #export parser +(def: .public parser (Parser Version) (<| (<xml>.node ..<snapshot_version>) ($_ <>.and diff --git a/stdlib/source/program/aedifex/artifact/snapshot/version/value.lux b/stdlib/source/program/aedifex/artifact/snapshot/version/value.lux index ce9a09f1a..55ece62c7 100644 --- a/stdlib/source/program/aedifex/artifact/snapshot/version/value.lux +++ b/stdlib/source/program/aedifex/artifact/snapshot/version/value.lux @@ -11,11 +11,11 @@ ["#." time] ["#." stamp]]) -(type: #export Value +(type: .public Value {#version Text #snapshot Snapshot}) -(def: #export equivalence +(def: .public equivalence (Equivalence Value) ($_ product.equivalence text.equivalence @@ -25,10 +25,10 @@ (def: separator "-") -(def: #export snapshot +(def: .public snapshot "SNAPSHOT") -(def: #export (format (^slots [#version #snapshot])) +(def: .public (format (^slots [#version #snapshot])) (%.Format Value) (case snapshot #///.Local diff --git a/stdlib/source/program/aedifex/artifact/time.lux b/stdlib/source/program/aedifex/artifact/time.lux index c8452a477..4a0a20ea3 100644 --- a/stdlib/source/program/aedifex/artifact/time.lux +++ b/stdlib/source/program/aedifex/artifact/time.lux @@ -19,37 +19,37 @@ ["#." date] ["#." time]]) -(type: #export Time +(type: .public Time [/date.Date /time.Time]) -(def: #export epoch +(def: .public epoch Time [/date.epoch time.midnight]) -(def: #export (instant time) +(def: .public (instant time) (-> Time Instant) (let [[date time] time] (instant.of_date_time (/date.value date) time))) -(def: #export (of_instant instant) +(def: .public (of_instant instant) (-> Instant (Try Time)) (do try.monad [date (/date.date (instant.date instant))] (in [date (instant.time instant)]))) -(def: #export equivalence +(def: .public equivalence (Equivalence Time) (product.equivalence /date.equivalence time.equivalence)) -(def: #export (format [date time]) +(def: .public (format [date time]) (Format Time) (%.format (/date.format date) (/time.format time))) -(def: #export parser +(def: .public parser (Parser Time) (do <>.monad [date /date.parser diff --git a/stdlib/source/program/aedifex/artifact/time/date.lux b/stdlib/source/program/aedifex/artifact/time/date.lux index b392a5569..6e84811e6 100644 --- a/stdlib/source/program/aedifex/artifact/time/date.lux +++ b/stdlib/source/program/aedifex/artifact/time/date.lux @@ -23,7 +23,7 @@ [type abstract]]]) -(def: #export (pad value) +(def: .public (pad value) (-> Nat Text) (if (n.< 10 value) (%.format "0" (%.nat value)) @@ -32,20 +32,22 @@ (def: min_year +1,000) (def: max_year +9,999) -(exception: #export (year_is_out_of_range {year year.Year}) +(exception: .public (year_is_out_of_range {year year.Year}) (exception.report ["Minimum" (%.int ..min_year)] ["Maximum" (%.int ..max_year)] ["Year" (%.int (year.value year))])) -(abstract: #export Date +(abstract: .public Date + {} + date.Date - (def: #export epoch + (def: .public epoch Date (:abstraction date.epoch)) - (def: #export (date raw) + (def: .public (date raw) (-> date.Date (Try Date)) (let [year (|> raw date.year year.value)] (if (and (i.>= ..min_year year) @@ -53,24 +55,24 @@ (#try.Success (:abstraction raw)) (exception.except ..year_is_out_of_range [(date.year raw)])))) - (def: #export value + (def: .public value (-> Date date.Date) (|>> :representation)) - (implementation: #export equivalence + (implementation: .public equivalence (Equivalence Date) (def: (= reference subject) (date\= (:representation reference) (:representation subject)))) - (def: #export (format value) + (def: .public (format value) (%.Format Date) (%.format (|> value :representation date.year year.value .nat %.nat) (|> value :representation date.month month.number ..pad) (|> value :representation date.day_of_month ..pad))) - (def: #export parser + (def: .public parser (Parser Date) (do <>.monad [year (<>.codec n.decimal (<text>.exactly 4 <text>.decimal)) diff --git a/stdlib/source/program/aedifex/artifact/time/time.lux b/stdlib/source/program/aedifex/artifact/time/time.lux index 78b85f8cd..8b33d5732 100644 --- a/stdlib/source/program/aedifex/artifact/time/time.lux +++ b/stdlib/source/program/aedifex/artifact/time/time.lux @@ -16,17 +16,17 @@ ["." // #_ ["#" date]]) -(type: #export Time +(type: .public Time time.Time) -(def: #export (format value) +(def: .public (format value) (%.Format Time) (let [(^slots [#time.hour #time.minute #time.second]) (time.clock value)] (%.format (//.pad hour) (//.pad minute) (//.pad second)))) -(def: #export parser +(def: .public parser (<text>.Parser Time) (do <>.monad [hour (<>.codec n.decimal (<text>.exactly 2 <text>.decimal)) diff --git a/stdlib/source/program/aedifex/artifact/type.lux b/stdlib/source/program/aedifex/artifact/type.lux index 22cbd8253..dde76fc0c 100644 --- a/stdlib/source/program/aedifex/artifact/type.lux +++ b/stdlib/source/program/aedifex/artifact/type.lux @@ -3,11 +3,11 @@ [lux (#- Type)]]) ## https://maven.apache.org/ref/3.6.3/maven-core/artifact-handlers.html -(type: #export Type +(type: .public Type Text) (template [<type> <name>] - [(def: #export <name> + [(def: .public <name> Type <type>)] diff --git a/stdlib/source/program/aedifex/artifact/versioning.lux b/stdlib/source/program/aedifex/artifact/versioning.lux index 44973b54e..9e6ff8244 100644 --- a/stdlib/source/program/aedifex/artifact/versioning.lux +++ b/stdlib/source/program/aedifex/artifact/versioning.lux @@ -30,17 +30,17 @@ ["#." snapshot (#+ Snapshot) ["#/." version (#+ Version)]]]) -(type: #export Versioning +(type: .public Versioning {#snapshot Snapshot #last_updated //time.Time #versions (List Version)}) -(def: #export init +(def: .public init {#snapshot #//snapshot.Local #last_updated //time.epoch #versions (list)}) -(def: #export equivalence +(def: .public equivalence (Equivalence Versioning) ($_ product.equivalence //snapshot.equivalence @@ -61,7 +61,7 @@ (-> //time.Time XML) (|>> //time.format #xml.Text list (#xml.Node ..<last_updated> xml.attributes))) -(def: #export (format (^slots [#snapshot #last_updated #versions])) +(def: .public (format (^slots [#snapshot #last_updated #versions])) (-> Versioning XML) (<| (#xml.Node ..<versioning> xml.attributes) (list (//snapshot.format snapshot) @@ -80,7 +80,7 @@ (<| (<text>.then //time.parser) (..text ..<last_updated>))) -(def: #export parser +(def: .public parser (Parser Versioning) (<| (<xml>.node ..<versioning>) ($_ <>.and |