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/time | |
parent | 17e7566be51df5e428a6b10e6469201a8a9468da (diff) |
No more #export magic syntax.
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/program/aedifex/artifact/time.lux | 14 | ||||
-rw-r--r-- | stdlib/source/program/aedifex/artifact/time/date.lux | 20 | ||||
-rw-r--r-- | stdlib/source/program/aedifex/artifact/time/time.lux | 6 |
3 files changed, 21 insertions, 19 deletions
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)) |