From 9e2f1e76f2c8df01ed7687d934c3210fcf676bd6 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Thu, 16 Jun 2022 00:48:19 -0400 Subject: De-sigil-ification: suffix : [Part 13] --- stdlib/source/program/aedifex/artifact/time/date.lux | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 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 027ec6004..ba908f0af 100644 --- a/stdlib/source/program/aedifex/artifact/time/date.lux +++ b/stdlib/source/program/aedifex/artifact/time/date.lux @@ -23,14 +23,14 @@ [type [primitive (.except)]]]]) -(def: .public (pad value) +(def .public (pad value) (-> Nat Text) (if (n.< 10 value) (%.format "0" (%.nat value)) (%.nat value))) -(def: min_year +1,000) -(def: max_year +9,999) +(def min_year +1,000) +(def max_year +9,999) (exception: .public (year_is_out_of_range [year year.Year]) (exception.report @@ -41,11 +41,11 @@ (primitive .public Date date.Date - (def: .public epoch + (def .public epoch Date (abstraction date.epoch)) - (def: .public (date raw) + (def .public (date raw) (-> date.Date (Try Date)) (let [year (|> raw date.year year.value)] (if (or (i.< ..min_year year) @@ -53,24 +53,24 @@ (exception.except ..year_is_out_of_range [(date.year raw)]) {try.#Success (abstraction raw)}))) - (def: .public value + (def .public value (-> Date date.Date) (|>> representation)) - (def: .public equivalence + (def .public equivalence (Equivalence Date) (implementation - (def: (= reference subject) + (def (= reference subject) (date#= (representation reference) (representation subject))))) - (def: .public (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: .public parser + (def .public parser (Parser Date) (do <>.monad [year (<>.codec n.decimal (.exactly 4 .decimal)) -- cgit v1.2.3