diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/library/lux/time/year.lux | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/stdlib/source/library/lux/time/year.lux b/stdlib/source/library/lux/time/year.lux index 95280df9c..b3f3e7ecf 100644 --- a/stdlib/source/library/lux/time/year.lux +++ b/stdlib/source/library/lux/time/year.lux @@ -32,7 +32,7 @@ year (dec year))) -(exception: #export there-is-no-year-0) +(exception: #export there_is_no_year_0) (abstract: #export Year Int @@ -40,7 +40,7 @@ (def: #export (year value) (-> Int (Try Year)) (case value - +0 (exception.throw ..there-is-no-year-0 []) + +0 (exception.throw ..there_is_no_year_0 []) _ (#try.Success (:abstraction (..internal value))))) (def: #export value @@ -80,9 +80,9 @@ (or (not (..divisible? (.int ..century) year)) (..divisible? (.int ..era) year))))) -(def: (with-year-0-leap year days) - (let [after-year-0? (i.> +0 year)] - (if after-year-0? +(def: (with_year_0_leap year days) + (let [after_year_0? (i.> +0 year)] + (if after_year_0? (i.+ +1 days) days))) @@ -100,7 +100,7 @@ [i.- ..century] [i.+ ..era] )) - (..with-year-0-leap year))))) + (..with_year_0_leap year))))) (def: (encode year) (-> Year Text) @@ -114,10 +114,10 @@ (do {! <>.monad} [sign (<>.or (<t>.this "-") (wrap [])) digits (<t>.many <t>.decimal) - raw-year (<>.codec i.decimal (wrap (text\compose "+" digits)))] + raw_year (<>.codec i.decimal (wrap (text\compose "+" digits)))] (<>.lift (..year (case sign - (#.Left _) (i.* -1 raw-year) - (#.Right _) raw-year))))) + (#.Left _) (i.* -1 raw_year) + (#.Right _) raw_year))))) (implementation: #export codec {#.doc (doc "Based on ISO 8601." |