blob: 0eab45a149f8f8d1316192b2f6a569c5317d0b7d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
(.module:
[lux #*
[abstract
[monad (#+ do)]]
[control
["<>" parser
["<.>" text (#+ Parser)]]]
[data
[text
["%" format]]]
[time
["." instant (#+ Instant)]]]
["." / #_
["#." date]
["#." time]])
(type: #export Time_Stamp
Instant)
(def: #export separator
".")
(def: #export (format value)
(%.Format Time_Stamp)
(%.format (/date.format (instant.date value))
..separator
(/time.format (instant.time value))))
(def: #export parser
(Parser Time_Stamp)
(do <>.monad
[date /date.parser
_ (<text>.this ..separator)
time /time.parser]
(wrap (instant.from_date_time date time))))
|