From f621a133e6e0a516c0586270fea8eaffb4829d82 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sun, 8 Aug 2021 17:56:15 -0400 Subject: No more #export magic syntax. --- stdlib/source/program/aedifex/artifact/time/date.lux | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'stdlib/source/program/aedifex/artifact/time/date.lux') 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 (.exactly 4 .decimal)) -- cgit v1.2.3