diff options
Diffstat (limited to 'stdlib/source/lux/time/instant.lux')
-rw-r--r-- | stdlib/source/lux/time/instant.lux | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/stdlib/source/lux/time/instant.lux b/stdlib/source/lux/time/instant.lux index a8d308951..bd378016a 100644 --- a/stdlib/source/lux/time/instant.lux +++ b/stdlib/source/lux/time/instant.lux @@ -23,7 +23,7 @@ [type abstract]] [// - ["." duration] + ["." duration (#+ Duration)] ["." date (#+ Date)] ["." month (#+ Month)] ["." day (#+ Day)]]) @@ -41,19 +41,19 @@ (|>> :representation)) (def: #export (span from to) - (-> Instant Instant duration.Duration) + (-> Instant Instant Duration) (duration.from-millis (i.- (:representation from) (:representation to)))) (def: #export (shift duration instant) - (-> duration.Duration Instant Instant) + (-> Duration Instant Instant) (:abstraction (i.+ (duration.to-millis duration) (:representation instant)))) (def: #export (relative instant) - (-> Instant duration.Duration) + (-> Instant Duration) (|> instant :representation duration.from-millis)) (def: #export (absolute offset) - (-> duration.Duration Instant) + (-> Duration Instant) (|> offset duration.to-millis :abstraction)) (structure: #export equivalence (Equivalence Instant) @@ -94,7 +94,7 @@ (def: epoch-year Int +1970) (def: (find-year now) - (-> Instant [Int duration.Duration]) + (-> Instant [Int Duration]) (loop [reference epoch-year time-left (relative now)] (let [year (if (leap-year? reference) @@ -108,7 +108,7 @@ )))) (def: (find-month months time) - (-> (Row Nat) duration.Duration [Nat duration.Duration]) + (-> (Row Nat) Duration [Nat Duration]) (if (order.>= duration.order duration.empty time) (row@fold (function (_ month-days [current-month time-left]) (let [month-duration (duration.scale-up month-days duration.day)] @@ -132,7 +132,7 @@ (i@encode value))) (def: (adjust-negative space duration) - (-> duration.Duration duration.Duration duration.Duration) + (-> Duration Duration Duration) (if (duration.negative? duration) (duration.merge space duration) duration)) @@ -149,7 +149,7 @@ (def: days-up-to-epoch Int +719468) (def: (extract-date instant) - (-> Instant [[Int Int Int] duration.Duration]) + (-> Instant [[Int Int Int] Duration]) (let [offset (relative instant) seconds (duration.query duration.second offset) z (|> seconds (i./ seconds-per-day) (i.+ days-up-to-epoch)) |