diff options
Diffstat (limited to 'stdlib/source/lux/tool/compiler/phase/translation/js/primitive.lux')
-rw-r--r-- | stdlib/source/lux/tool/compiler/phase/translation/js/primitive.lux | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/stdlib/source/lux/tool/compiler/phase/translation/js/primitive.lux b/stdlib/source/lux/tool/compiler/phase/translation/js/primitive.lux index d99eec0e9..7b475c2e7 100644 --- a/stdlib/source/lux/tool/compiler/phase/translation/js/primitive.lux +++ b/stdlib/source/lux/tool/compiler/phase/translation/js/primitive.lux @@ -1,23 +1,19 @@ (.module: - [lux (#- int) + [lux (#- i64) [control [pipe (#+ cond> new>)]] [data [number ["." i64] - ["." frac]] - [text - format]] + ["." frac]]] [host ["_" js (#+ Expression)]]] [// - ["//." runtime (#+ Operation)] - [// - ["//." // ("#/." monad)]]]) + ["//." runtime]]) (def: #export bit - (-> Bit (Operation Expression)) - (|>> _.boolean /////wrap)) + (-> Bit Expression) + _.boolean) (def: high (-> Int Int) @@ -28,13 +24,13 @@ (let [mask (dec (i64.left-shift 32 1))] (|>> (i64.and mask)))) -(def: #export (int value) - (-> Int (Operation Expression)) - (/////wrap (//runtime.i64//new (|> value ..high _.i32) - (|> value ..low _.i32)))) +(def: #export (i64 value) + (-> Int Expression) + (//runtime.i64//new (|> value ..high _.i32) + (|> value ..low _.i32))) -(def: #export frac - (-> Frac (Operation Expression)) +(def: #export f64 + (-> Frac Expression) (|>> (cond> [(f/= frac.positive-infinity)] [(new> _.positive-infinity [])] @@ -45,9 +41,8 @@ [(new> _.not-a-number [])] ## else - [_.number]) - /////wrap)) + [_.number]))) (def: #export text - (-> Text (Operation Expression)) - (|>> _.string /////wrap)) + (-> Text Expression) + _.string) |