aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program/aedifex/artifact
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/program/aedifex/artifact/time.lux35
-rw-r--r--stdlib/source/program/aedifex/artifact/time/date.lux (renamed from stdlib/source/program/aedifex/artifact/time_stamp/date.lux)0
-rw-r--r--stdlib/source/program/aedifex/artifact/time/time.lux (renamed from stdlib/source/program/aedifex/artifact/time_stamp/time.lux)0
3 files changed, 35 insertions, 0 deletions
diff --git a/stdlib/source/program/aedifex/artifact/time.lux b/stdlib/source/program/aedifex/artifact/time.lux
new file mode 100644
index 000000000..19eb417a5
--- /dev/null
+++ b/stdlib/source/program/aedifex/artifact/time.lux
@@ -0,0 +1,35 @@
+(.module:
+ [lux #*
+ [abstract
+ [equivalence (#+ Equivalence)]
+ [monad (#+ do)]]
+ [control
+ ["<>" parser
+ ["<.>" text (#+ Parser)]]]
+ [data
+ [text
+ ["%" format (#+ Format)]]]
+ [time
+ ["." instant (#+ Instant)]]]
+ ["." / #_
+ ["#." date]
+ ["#." time]])
+
+(type: #export Time
+ Instant)
+
+(def: #export equivalence
+ (Equivalence Time)
+ instant.equivalence)
+
+(def: #export (format value)
+ (Format Time)
+ (%.format (/date.format (instant.date value))
+ (/time.format (instant.time value))))
+
+(def: #export parser
+ (Parser Time)
+ (do <>.monad
+ [date /date.parser
+ time /time.parser]
+ (wrap (instant.from_date_time date time))))
diff --git a/stdlib/source/program/aedifex/artifact/time_stamp/date.lux b/stdlib/source/program/aedifex/artifact/time/date.lux
index 18df2900b..18df2900b 100644
--- a/stdlib/source/program/aedifex/artifact/time_stamp/date.lux
+++ b/stdlib/source/program/aedifex/artifact/time/date.lux
diff --git a/stdlib/source/program/aedifex/artifact/time_stamp/time.lux b/stdlib/source/program/aedifex/artifact/time/time.lux
index d14f0a435..d14f0a435 100644
--- a/stdlib/source/program/aedifex/artifact/time_stamp/time.lux
+++ b/stdlib/source/program/aedifex/artifact/time/time.lux