diff options
Diffstat (limited to 'stdlib/source/program/aedifex/artifact')
-rw-r--r-- | stdlib/source/program/aedifex/artifact/time.lux | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/stdlib/source/program/aedifex/artifact/time.lux b/stdlib/source/program/aedifex/artifact/time.lux index 59367c37d..b227c3954 100644 --- a/stdlib/source/program/aedifex/artifact/time.lux +++ b/stdlib/source/program/aedifex/artifact/time.lux @@ -5,12 +5,15 @@ [equivalence (#+ Equivalence)] [monad (#+ do)]] [control + ["." try (#+ Try)] ["<>" parser ["<.>" text (#+ Parser)]]] [data ["." product] [text - ["%" format (#+ Format)]]]] + ["%" format (#+ Format)]]] + [time + ["." instant (#+ Instant)]]] ["." / #_ ["#." date] ["#." time]]) @@ -22,6 +25,13 @@ Time [/date.epoch time.midnight]) +(def: #export (from_instant instant) + (-> Instant (Try Time)) + (do try.monad + [date (/date.date (instant.date instant))] + (wrap [date + (instant.time instant)]))) + (def: #export equivalence (Equivalence Time) (product.equivalence /date.equivalence |