From 519c0c0c71cdf7ce3dfc64b9781ab826760b3d94 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Mon, 14 Jun 2021 18:33:54 -0400 Subject: Extracted Licentia out of the standard library. --- stdlib/source/program/aedifex/artifact/time.lux | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'stdlib/source/program/aedifex/artifact') 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 -- cgit v1.2.3