aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program/aedifex/artifact/snapshot/time.lux
diff options
context:
space:
mode:
authorEduardo Julian2021-01-13 17:42:20 -0400
committerEduardo Julian2021-01-13 17:42:20 -0400
commitae56acf791c2ed9bd5865f85fffa00b025d310fe (patch)
treed02c6f67240b27c578b7e8ca17285824eae56497 /stdlib/source/program/aedifex/artifact/snapshot/time.lux
parent71de092a045dc70ab1c9eead477cf1512b144a87 (diff)
Removed the (ultimately redundant) on_stop function for actors.
Diffstat (limited to 'stdlib/source/program/aedifex/artifact/snapshot/time.lux')
-rw-r--r--stdlib/source/program/aedifex/artifact/snapshot/time.lux45
1 files changed, 45 insertions, 0 deletions
diff --git a/stdlib/source/program/aedifex/artifact/snapshot/time.lux b/stdlib/source/program/aedifex/artifact/snapshot/time.lux
new file mode 100644
index 000000000..ea9bf3047
--- /dev/null
+++ b/stdlib/source/program/aedifex/artifact/snapshot/time.lux
@@ -0,0 +1,45 @@
+(.module:
+ [lux #*
+ [abstract
+ [equivalence (#+ Equivalence)]
+ [monad (#+ do)]]
+ [control
+ ["." exception (#+ exception:)]
+ ["<>" parser
+ ["<.>" text]
+ ["<.>" xml (#+ Parser)]]]
+ [data
+ [text
+ ["%" format]]
+ [format
+ ["." xml (#+ XML)]]]
+ [time
+ ["." instant (#+ Instant)]]]
+ ["." /// #_
+ [time
+ ["#." date]
+ ["#." time]]])
+
+(type: #export Time
+ Instant)
+
+(def: #export equivalence
+ (Equivalence Time)
+ instant.equivalence)
+
+(def: separator
+ ".")
+
+(def: #export (format value)
+ (%.Format Time)
+ (%.format (///date.format (instant.date value))
+ ..separator
+ (///time.format (instant.time value))))
+
+(def: #export parser
+ (<text>.Parser Time)
+ (do <>.monad
+ [date ///date.parser
+ _ (<text>.this ..separator)
+ time ///time.parser]
+ (wrap (instant.from_date_time date time))))