diff options
Diffstat (limited to 'stdlib/source/lux/time/instant.lux')
-rw-r--r-- | stdlib/source/lux/time/instant.lux | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/stdlib/source/lux/time/instant.lux b/stdlib/source/lux/time/instant.lux index 61cadce14..05f54b30b 100644 --- a/stdlib/source/lux/time/instant.lux +++ b/stdlib/source/lux/time/instant.lux @@ -12,7 +12,7 @@ ["." try] ["." exception (#+ exception:)] ["<>" parser - ["<t>" text (#+ Parser)]]] + ["<.>" text (#+ Parser)]]] [data ["." maybe] ["." text ("#\." monoid)] @@ -132,9 +132,9 @@ (Parser Instant) (do {! <>.monad} [days (\ ! map date.to_days date.parser) - _ (<t>.this ..date_suffix) + _ (<text>.this ..date_suffix) time (\ ! map //.to_millis //.parser) - _ (<t>.this ..time_suffix)] + _ (<text>.this ..time_suffix)] (wrap (|> (if (i.< +0 days) (|> duration.day (duration.up (.nat (i.* -1 days))) @@ -149,7 +149,7 @@ (Codec Text Instant) (def: encode ..encode) - (def: decode (<t>.run ..parser))) + (def: decode (<text>.run ..parser))) (def: #export now (IO Instant) @@ -157,38 +157,38 @@ @.jvm (|> ("jvm member invoke static" [] "java.lang.System" "currentTimeMillis" []) ("jvm object cast") (: (primitive "java.lang.Long")) - (:coerce Int)) + (:as Int)) @.js (let [date ("js object new" ("js constant" "Date") [])] (|> ("js object do" "getTime" date []) - (:coerce Frac) + (:as Frac) "lux f64 i64")) @.python (let [time ("python import" "time")] (|> ("python object do" "time" time) - (:coerce Frac) + (:as Frac) (f.* +1,000.0) "lux f64 i64")) @.lua (|> ("lua constant" "os.time") "lua apply" - (:coerce Int) + (:as Int) (i.* +1,000)) @.ruby (let [% ("ruby constant" "Time") % ("ruby object do" "now" %)] (|> ("ruby object do" "to_f" %) - (:coerce Frac) + (:as Frac) (f.* +1,000.0) "lux f64 i64")) @.php (|> ("php constant" "time") "php apply" - (:coerce Int) + (:as Int) (i.* +1,000)) @.scheme (|> ("scheme constant" "current-second") - (:coerce Int) + (:as Int) (i.* +1,000) ("scheme apply" ("scheme constant" "exact")) ("scheme apply" ("scheme constant" "truncate"))) @.common_lisp (|> ("common_lisp constant" "get-universal-time") "common_lisp apply" - (:coerce Int) + (:as Int) (i.* +1,000)) })))) |