diff --git a/licentia/source/program/licentia/input.lux b/licentia/source/program/licentia/input.lux index 80933aecdf..6e0b014cab 100644 --- a/licentia/source/program/licentia/input.lux +++ b/licentia/source/program/licentia/input.lux @@ -19,7 +19,7 @@ [number ["n" nat] ["i" int] - ["f" frac]]]]] + ["d" dec]]]]] ["[0]" // ["[1]" license (.only Identification Termination @@ -47,7 +47,7 @@ (exception.report (list ["Amount" ( it)]))) - [cannot_use_fractional_amount Frac %.frac] + [cannot_use_fractional_amount Dec %.dec] [cannot_use_negative_amount Int %.int] ) @@ -55,10 +55,10 @@ (Parser Nat) (do <>.monad [amountF .number - #let [amountI (f.int amountF)] + #let [amountI (d.int amountF)] _ (<>.assert (exception.construct ..cannot_use_fractional_amount [amountF]) - (f.= amountF - (i.frac amountI))) + (d.= amountF + (i.dec amountI))) _ (<>.assert (exception.construct ..cannot_use_negative_amount [amountI]) (i.> +0 amountI))] (wrap (.nat amountI)))) diff --git a/lux-bootstrapper/src/lux/analyser.clj b/lux-bootstrapper/src/lux/analyser.clj index 9b372bc58b..a9fc6a2979 100644 --- a/lux-bootstrapper/src/lux/analyser.clj +++ b/lux-bootstrapper/src/lux/analyser.clj @@ -58,9 +58,9 @@ (|do [_ (&type/check exo-type &type/Rev)] (return (&/|list (&&/|meta exo-type location (&&/$rev ?value))))) - (&/$Frac ?value) - (|do [_ (&type/check exo-type &type/Frac)] - (return (&/|list (&&/|meta exo-type location (&&/$frac ?value))))) + (&/$Dec ?value) + (|do [_ (&type/check exo-type &type/Dec)] + (return (&/|list (&&/|meta exo-type location (&&/$dec ?value))))) (&/$Text ?value) (|do [_ (&type/check exo-type &type/Text)] diff --git a/lux-bootstrapper/src/lux/analyser/base.clj b/lux-bootstrapper/src/lux/analyser/base.clj index f336ecbe84..578b6e8207 100644 --- a/lux-bootstrapper/src/lux/analyser/base.clj +++ b/lux-bootstrapper/src/lux/analyser/base.clj @@ -13,7 +13,7 @@ ("nat" 1) ("int" 1) ("rev" 1) - ("frac" 1) + ("dec" 1) ("text" 1) ("variant" 3) ("tuple" 1) diff --git a/lux-bootstrapper/src/lux/analyser/case.clj b/lux-bootstrapper/src/lux/analyser/case.clj index 1e34747a77..c87540d079 100644 --- a/lux-bootstrapper/src/lux/analyser/case.clj +++ b/lux-bootstrapper/src/lux/analyser/case.clj @@ -19,7 +19,7 @@ ("NatTotal" 2) ("IntTotal" 2) ("RevTotal" 2) - ("FracTotal" 2) + ("DecTotal" 2) ("TextTotal" 2) ("TupleTotal" 2) ("VariantTotal" 2)) @@ -31,7 +31,7 @@ ("NatTestAC" 1) ("IntTestAC" 1) ("RevTestAC" 1) - ("FracTestAC" 1) + ("DecTestAC" 1) ("TextTestAC" 1) ("TupleTestAC" 1) ("VariantTestAC" 1)) @@ -335,10 +335,10 @@ =kont kont] (return (&/T [($RevTestAC ?value) =kont]))) - (&/$Frac ?value) - (|do [_ (&type/check value-type &type/Frac) + (&/$Dec ?value) + (|do [_ (&type/check value-type &type/Dec) =kont kont] - (return (&/T [($FracTestAC ?value) =kont]))) + (return (&/T [($DecTestAC ?value) =kont]))) (&/$Text ?value) (|do [_ (&type/check value-type &type/Text) @@ -436,8 +436,8 @@ ;; [($RevTotal total? ?values) ($NoTestAC)] ;; (return ($RevTotal true ?values)) -;; [($FracTotal total? ?values) ($NoTestAC)] -;; (return ($FracTotal true ?values)) +;; [($DecTotal total? ?values) ($NoTestAC)] +;; (return ($DecTotal true ?values)) ;; [($TextTotal total? ?values) ($NoTestAC)] ;; (return ($TextTotal true ?values)) @@ -463,8 +463,8 @@ ;; [($RevTotal total? ?values) ($StoreTestAC ?idx)] ;; (return ($RevTotal true ?values)) -;; [($FracTotal total? ?values) ($StoreTestAC ?idx)] -;; (return ($FracTotal true ?values)) +;; [($DecTotal total? ?values) ($StoreTestAC ?idx)] +;; (return ($DecTotal true ?values)) ;; [($TextTotal total? ?values) ($StoreTestAC ?idx)] ;; (return ($TextTotal true ?values)) @@ -499,11 +499,11 @@ ;; [($RevTotal total? ?values) ($RevTestAC ?value)] ;; (return ($RevTotal total? (&/$Item ?value ?values))) -;; [($DefaultTotal total?) ($FracTestAC ?value)] -;; (return ($FracTotal total? (&/|list ?value))) +;; [($DefaultTotal total?) ($DecTestAC ?value)] +;; (return ($DecTotal total? (&/|list ?value))) -;; [($FracTotal total? ?values) ($FracTestAC ?value)] -;; (return ($FracTotal total? (&/$Item ?value ?values))) +;; [($DecTotal total? ?values) ($DecTestAC ?value)] +;; (return ($DecTotal total? (&/$Item ?value ?values))) ;; [($DefaultTotal total?) ($TextTestAC ?value)] ;; (return ($TextTotal total? (&/|list ?value))) @@ -586,8 +586,8 @@ ;; (|do [_ (&type/check value-type &type/Rev)] ;; (return ?total)) -;; ($FracTotal ?total _) -;; (|do [_ (&type/check value-type &type/Frac)] +;; ($DecTotal ?total _) +;; (|do [_ (&type/check value-type &type/Dec)] ;; (return ?total)) ;; ($TextTotal ?total _) diff --git a/lux-bootstrapper/src/lux/analyser/parser.clj b/lux-bootstrapper/src/lux/analyser/parser.clj index f9a80f9762..39678bd9ae 100644 --- a/lux-bootstrapper/src/lux/analyser/parser.clj +++ b/lux-bootstrapper/src/lux/analyser/parser.clj @@ -149,11 +149,11 @@ [_ (&lexer/$Int param-value*)] &lexer/lex-int] (return (long param-value*))) - (|do [[_ (&lexer/$Frac param-value*)] &lexer/lex-frac] + (|do [[_ (&lexer/$Dec param-value*)] &lexer/lex-dec] (return (float param-value*))) (|do [_ (&reader/read-text "d") - [_ (&lexer/$Frac param-value*)] &lexer/lex-frac] + [_ (&lexer/$Dec param-value*)] &lexer/lex-dec] (return (double param-value*))) (|do [[_ (&lexer/$Text param-value*)] &lexer/lex-text] diff --git a/lux-bootstrapper/src/lux/analyser/proc/common.clj b/lux-bootstrapper/src/lux/analyser/proc/common.clj index 7dde1cd73a..eb93242d4f 100644 --- a/lux-bootstrapper/src/lux/analyser/proc/common.clj +++ b/lux-bootstrapper/src/lux/analyser/proc/common.clj @@ -158,13 +158,13 @@ ["i64" "%"] analyse-int-rem &type/Int &type/Int ["i64" "<"] analyse-int-lt &type/Int &type/Bit - ["f64" "+"] analyse-f64-add &type/Frac &type/Frac - ["f64" "-"] analyse-f64-sub &type/Frac &type/Frac - ["f64" "*"] analyse-f64-mul &type/Frac &type/Frac - ["f64" "/"] analyse-f64-div &type/Frac &type/Frac - ["f64" "%"] analyse-f64-rem &type/Frac &type/Frac - ["f64" "="] analyse-f64-eq &type/Frac &type/Bit - ["f64" "<"] analyse-f64-lt &type/Frac &type/Bit + ["f64" "+"] analyse-f64-add &type/Dec &type/Dec + ["f64" "-"] analyse-f64-sub &type/Dec &type/Dec + ["f64" "*"] analyse-f64-mul &type/Dec &type/Dec + ["f64" "/"] analyse-f64-div &type/Dec &type/Dec + ["f64" "%"] analyse-f64-rem &type/Dec &type/Dec + ["f64" "="] analyse-f64-eq &type/Dec &type/Bit + ["f64" "<"] analyse-f64-lt &type/Dec &type/Bit ) (do-template [ ] @@ -185,7 +185,7 @@ (return (&/|list (&&/|meta exo-type _location (&&/$proc (&/T ) (&/|list =x) (&/|list))))))))) - analyse-f64-encode ["f64" "encode"] analyse-f64-decode ["f64" "decode"] &type/Frac + analyse-f64-encode ["f64" "encode"] analyse-f64-decode ["f64" "decode"] &type/Dec ) (do-template [ ] @@ -197,12 +197,12 @@ (return (&/|list (&&/|meta exo-type _location (&&/$proc (&/T ) (&/|list =x) (&/|list))))))) - analyse-int-char &type/Int &type/Text ["i64" "char"] - analyse-int-frac &type/Int &type/Frac ["i64" "f64"] - analyse-f64-int &type/Frac &type/Int ["f64" "i64"] + analyse-int-char &type/Int &type/Text ["i64" "char"] + analyse-int-dec &type/Int &type/Dec ["i64" "f64"] + analyse-f64-int &type/Dec &type/Int ["f64" "i64"] - analyse-io-log &type/Text &type/Any ["io" "log"] - analyse-io-error &type/Text &type/Nothing ["io" "error"] + analyse-io-log &type/Text &type/Any ["io" "log"] + analyse-io-error &type/Text &type/Nothing ["io" "error"] ) (defn- analyse-syntax-char-case! [analyse exo-type ?values] @@ -280,7 +280,7 @@ "int_%#" (analyse-int-rem analyse exo-type ?values) "int_<#" (analyse-int-lt analyse exo-type ?values) - "int_f64#" (analyse-int-frac analyse exo-type ?values) + "int_f64#" (analyse-int-dec analyse exo-type ?values) "int_char#" (analyse-int-char analyse exo-type ?values) "f64_+#" (analyse-f64-add analyse exo-type ?values) diff --git a/lux-bootstrapper/src/lux/base.clj b/lux-bootstrapper/src/lux/base.clj index 529fca5f8e..982630727d 100644 --- a/lux-bootstrapper/src/lux/base.clj +++ b/lux-bootstrapper/src/lux/base.clj @@ -82,7 +82,7 @@ ("Nat" 1) ("Int" 1) ("Rev" 1) - ("Frac" 1) + ("Dec" 1) ("Text" 1) ("Identifier" 1) ("Form" 1) @@ -1262,7 +1262,7 @@ [_ ($Rev ?value)] (encode-rev ?value) - [_ ($Frac ?value)] + [_ ($Dec ?value)] (pr-str ?value) [_ ($Text ?value)] diff --git a/lux-bootstrapper/src/lux/compiler/cache/ann.clj b/lux-bootstrapper/src/lux/compiler/cache/ann.clj index 6b72741097..d07ba52bfd 100644 --- a/lux-bootstrapper/src/lux/compiler/cache/ann.clj +++ b/lux-bootstrapper/src/lux/compiler/cache/ann.clj @@ -37,10 +37,10 @@ (str "I" value stop) [_ (&/$Rev value)] - (str "D" value stop) + (str "R" value stop) - [_ (&/$Frac value)] - (str "F" value stop) + [_ (&/$Dec value)] + (str "D" value stop) [_ (&/$Text value)] (str "T" value stop) @@ -75,8 +75,8 @@ ^:private deserialize-bit "B" &/$Bit Boolean/parseBoolean ^:private deserialize-nat "N" &/$Nat Long/parseLong ^:private deserialize-int "I" &/$Int Long/parseLong - ^:private deserialize-rev "D" &/$Rev Long/parseLong - ^:private deserialize-frac "F" &/$Frac Double/parseDouble + ^:private deserialize-rev "R" &/$Rev Long/parseLong + ^:private deserialize-dec "D" &/$Dec Double/parseDouble ^:private deserialize-text "T" &/$Text identity ) @@ -118,7 +118,7 @@ (deserialize-nat input) (deserialize-int input) (deserialize-rev input) - (deserialize-frac input) + (deserialize-dec input) (deserialize-text input) (deserialize-identifier input) (deserialize-form input) diff --git a/lux-bootstrapper/src/lux/compiler/jvm.clj b/lux-bootstrapper/src/lux/compiler/jvm.clj index 915e377141..1c7bf33b9e 100644 --- a/lux-bootstrapper/src/lux/compiler/jvm.clj +++ b/lux-bootstrapper/src/lux/compiler/jvm.clj @@ -62,8 +62,8 @@ (&o/$rev ?value) (&&lux/compile-rev ?value) - (&o/$frac ?value) - (&&lux/compile-frac ?value) + (&o/$dec ?value) + (&&lux/compile-dec ?value) (&o/$text ?value) (&&lux/compile-text ?value) diff --git a/lux-bootstrapper/src/lux/compiler/jvm/case.clj b/lux-bootstrapper/src/lux/compiler/jvm/case.clj index 3aff3076ee..5dbb9d3511 100644 --- a/lux-bootstrapper/src/lux/compiler/jvm/case.clj +++ b/lux-bootstrapper/src/lux/compiler/jvm/case.clj @@ -97,7 +97,7 @@ (.visitInsn Opcodes/LCMP) (.visitJumpInsn Opcodes/IFNE $else)) - (&o/$FracPM _value) + (&o/$DecPM _value) (doto writer stack-peek &&/unwrap-double diff --git a/lux-bootstrapper/src/lux/compiler/jvm/lux.clj b/lux-bootstrapper/src/lux/compiler/jvm/lux.clj index 2ed748a1b0..43e71db7b1 100644 --- a/lux-bootstrapper/src/lux/compiler/jvm/lux.clj +++ b/lux-bootstrapper/src/lux/compiler/jvm/lux.clj @@ -40,10 +40,10 @@ (.visitMethodInsn Opcodes/INVOKESTATIC "valueOf" (str "(" ")" (&host-generics/->type-signature ))))]] (return nil))) - compile-nat "java/lang/Long" "J" long - compile-int "java/lang/Long" "J" long - compile-rev "java/lang/Long" "J" long - compile-frac "java/lang/Double" "D" double + compile-nat "java/lang/Long" "J" long + compile-int "java/lang/Long" "J" long + compile-rev "java/lang/Long" "J" long + compile-dec "java/lang/Double" "D" double ) (defn compile-text [?value] diff --git a/lux-bootstrapper/src/lux/compiler/jvm/proc/common.clj b/lux-bootstrapper/src/lux/compiler/jvm/proc/common.clj index 82d7174f52..ea9c1d957a 100644 --- a/lux-bootstrapper/src/lux/compiler/jvm/proc/common.clj +++ b/lux-bootstrapper/src/lux/compiler/jvm/proc/common.clj @@ -111,11 +111,11 @@ ^:private compile-int-div Opcodes/LDIV &&/unwrap-long &&/wrap-long ^:private compile-int-rem Opcodes/LREM &&/unwrap-long &&/wrap-long - ^:private compile-frac-add Opcodes/DADD &&/unwrap-double &&/wrap-double - ^:private compile-frac-sub Opcodes/DSUB &&/unwrap-double &&/wrap-double - ^:private compile-frac-mul Opcodes/DMUL &&/unwrap-double &&/wrap-double - ^:private compile-frac-div Opcodes/DDIV &&/unwrap-double &&/wrap-double - ^:private compile-frac-rem Opcodes/DREM &&/unwrap-double &&/wrap-double + ^:private compile-dec-add Opcodes/DADD &&/unwrap-double &&/wrap-double + ^:private compile-dec-sub Opcodes/DSUB &&/unwrap-double &&/wrap-double + ^:private compile-dec-mul Opcodes/DMUL &&/unwrap-double &&/wrap-double + ^:private compile-dec-div Opcodes/DDIV &&/unwrap-double &&/wrap-double + ^:private compile-dec-rem Opcodes/DREM &&/unwrap-double &&/wrap-double ) (do-template [ ] @@ -145,11 +145,11 @@ ^:private compile-int-lt Opcodes/LCMP -1 &&/unwrap-long - ^:private compile-frac-eq Opcodes/DCMPG 0 &&/unwrap-double - ^:private compile-frac-lt Opcodes/DCMPG -1 &&/unwrap-double + ^:private compile-dec-eq Opcodes/DCMPG 0 &&/unwrap-double + ^:private compile-dec-lt Opcodes/DCMPG -1 &&/unwrap-double ) -(defn ^:private compile-frac-encode [compile ?values special-args] +(defn ^:private compile-dec-encode [compile ?values special-args] (|do [:let [(&/$Item ?input (&/$End)) ?values] ^MethodVisitor *writer* &/get-writer _ (compile ?input) @@ -158,13 +158,13 @@ (.visitMethodInsn Opcodes/INVOKESTATIC "java/lang/Double" "toString" "(D)Ljava/lang/String;"))]] (return nil))) -(defn ^:private compile-frac-decode [compile ?values special-args] +(defn ^:private compile-dec-decode [compile ?values special-args] (|do [:let [(&/$Item ?input (&/$End)) ?values] ^MethodVisitor *writer* &/get-writer _ (compile ?input) :let [_ (doto *writer* (.visitTypeInsn Opcodes/CHECKCAST "java/lang/String") - (.visitMethodInsn Opcodes/INVOKESTATIC &rt/runtime-class "decode_frac" "(Ljava/lang/String;)[Ljava/lang/Object;"))]] + (.visitMethodInsn Opcodes/INVOKESTATIC &rt/runtime-class "decode_dec" "(Ljava/lang/String;)[Ljava/lang/Object;"))]] (return nil))) (defn ^:private compile-int-char [compile ?values special-args] @@ -189,8 +189,8 @@ )]] (return nil))) - ^:private compile-frac-int &&/unwrap-double Opcodes/D2L &&/wrap-long - ^:private compile-int-frac &&/unwrap-long Opcodes/L2D &&/wrap-double + ^:private compile-dec-int &&/unwrap-double Opcodes/D2L &&/wrap-long + ^:private compile-int-dec &&/unwrap-long Opcodes/L2D &&/wrap-double ) (defn ^:private compile-text-eq [compile ?values special-args] @@ -445,22 +445,22 @@ "/" (compile-int-div compile ?values special-args) "%" (compile-int-rem compile ?values special-args) "<" (compile-int-lt compile ?values special-args) - "f64" (compile-int-frac compile ?values special-args) + "f64" (compile-int-dec compile ?values special-args) "char" (compile-int-char compile ?values special-args) ) "f64" (case proc - "+" (compile-frac-add compile ?values special-args) - "-" (compile-frac-sub compile ?values special-args) - "*" (compile-frac-mul compile ?values special-args) - "/" (compile-frac-div compile ?values special-args) - "%" (compile-frac-rem compile ?values special-args) - "=" (compile-frac-eq compile ?values special-args) - "<" (compile-frac-lt compile ?values special-args) - "i64" (compile-frac-int compile ?values special-args) - "encode" (compile-frac-encode compile ?values special-args) - "decode" (compile-frac-decode compile ?values special-args) + "+" (compile-dec-add compile ?values special-args) + "-" (compile-dec-sub compile ?values special-args) + "*" (compile-dec-mul compile ?values special-args) + "/" (compile-dec-div compile ?values special-args) + "%" (compile-dec-rem compile ?values special-args) + "=" (compile-dec-eq compile ?values special-args) + "<" (compile-dec-lt compile ?values special-args) + "i64" (compile-dec-int compile ?values special-args) + "encode" (compile-dec-encode compile ?values special-args) + "decode" (compile-dec-decode compile ?values special-args) ) ;; else diff --git a/lux-bootstrapper/src/lux/compiler/jvm/rt.clj b/lux-bootstrapper/src/lux/compiler/jvm/rt.clj index d51c359839..04ba6b8398 100644 --- a/lux-bootstrapper/src/lux/compiler/jvm/rt.clj +++ b/lux-bootstrapper/src/lux/compiler/jvm/rt.clj @@ -286,7 +286,7 @@ (.visitEnd))) nil)) - ^:private compile-Runtime-frac-methods "decode_frac" "java/lang/Double" "parseDouble" "(Ljava/lang/String;)D" &&/wrap-double + ^:private compile-Runtime-dec-methods "decode_dec" "java/lang/Double" "parseDouble" "(Ljava/lang/String;)D" &&/wrap-double ) (defn peekI [^MethodVisitor writer] @@ -430,6 +430,6 @@ _ (doto =class (compile-Runtime-pm-methods) (compile-Runtime-adt-methods) - (compile-Runtime-frac-methods))]] + (compile-Runtime-dec-methods))]] (&&/save-class! (-> &&/lux-utils-class (string/split #"/") (nth 2)) (.toByteArray (doto =class .visitEnd))))) diff --git a/lux-bootstrapper/src/lux/lexer.clj b/lux-bootstrapper/src/lux/lexer.clj index 4c8263d15c..01bebc3440 100644 --- a/lux-bootstrapper/src/lux/lexer.clj +++ b/lux-bootstrapper/src/lux/lexer.clj @@ -16,7 +16,7 @@ ("Nat" 1) ("Int" 1) ("Rev" 1) - ("Frac" 1) + ("Dec" 1) ("Text" 1) ("Identifier" 1) ("Open_Paren" 0) @@ -61,10 +61,10 @@ (|do [[meta _ token] (&reader/read-regex )] (return (&/T [meta ( (string/replace token #"," ""))])))) - lex-nat $Nat #"^[0-9][0-9,]*" - lex-int $Int #"^(-|\+)[0-9][0-9,]*" - lex-rev $Rev #"^\.[0-9][0-9,]*" - lex-frac $Frac #"^(-|\+)[0-9][0-9,]*\.[0-9][0-9,]*((e|E)(-|\+)[0-9][0-9,]*)?" + lex-nat $Nat #"^[0-9][0-9,]*" + lex-int $Int #"^(-|\+)[0-9][0-9,]*" + lex-rev $Rev #"^\.[0-9][0-9,]*" + lex-dec $Dec #"^(-|\+)[0-9][0-9,]*\.[0-9][0-9,]*((e|E)(-|\+)[0-9][0-9,]*)?" ) (def +same-module-mark+ (str &/+name-separator+ &/+name-separator+)) @@ -125,7 +125,7 @@ lex-comment lex-bit lex-nat - lex-frac + lex-dec lex-rev lex-int lex-text diff --git a/lux-bootstrapper/src/lux/optimizer.clj b/lux-bootstrapper/src/lux/optimizer.clj index af3182d5cb..6b5119ef6f 100644 --- a/lux-bootstrapper/src/lux/optimizer.clj +++ b/lux-bootstrapper/src/lux/optimizer.clj @@ -13,7 +13,7 @@ ("nat" 1) ("int" 1) ("rev" 1) - ("frac" 1) + ("dec" 1) ("text" 1) ("variant" 3) ("tuple" 1) @@ -76,8 +76,8 @@ ("IntPM" 1) ;; Compare the CDN with a revolution value. ("RevPM" 1) - ;; Compare the CDN with a frac value. - ("FracPM" 1) + ;; Compare the CDN with a dec value. + ("DecPM" 1) ;; Compare the CDN with a text value. ("TextPM" 1) ;; Compare the CDN with a variant value. If valid, proceed to test @@ -193,8 +193,8 @@ (&/|list ($RevPM _value) $PopPM) - (&a-case/$FracTestAC _value) - (&/|list ($FracPM _value) + (&a-case/$DecTestAC _value) + (&/|list ($DecPM _value) $PopPM) (&a-case/$TextTestAC _value) @@ -298,9 +298,9 @@ ($RevPM _pre-value) ($AltPM pre post)) - [($FracPM _pre-value) ($FracPM _post-value)] + [($DecPM _pre-value) ($DecPM _post-value)] (if (= _pre-value _post-value) - ($FracPM _pre-value) + ($DecPM _pre-value) ($AltPM pre post)) [($TextPM _pre-value) ($TextPM _post-value)] @@ -1029,8 +1029,8 @@ (&a/$rev value) (&/T [meta ($rev value)]) - (&a/$frac value) - (&/T [meta ($frac value)]) + (&a/$dec value) + (&/T [meta ($dec value)]) (&a/$text value) (&/T [meta ($text value)]) @@ -1177,7 +1177,7 @@ ;; 3 ($rev it) `(~'$rev ~it) ;; 4 - ($frac it) `(~'$frac ~it) + ($dec it) `(~'$dec ~it) ;; 5 ($text it) `(~'$text ~it) ;; 6 diff --git a/lux-bootstrapper/src/lux/parser.clj b/lux-bootstrapper/src/lux/parser.clj index 6a24ee73aa..84c5db86f4 100644 --- a/lux-bootstrapper/src/lux/parser.clj +++ b/lux-bootstrapper/src/lux/parser.clj @@ -62,8 +62,8 @@ (&lexer/$Rev ?value) (return (&/|list (&/T [meta (&/$Rev (&/decode-rev ?value))]))) - (&lexer/$Frac ?value) - (return (&/|list (&/T [meta (&/$Frac (Double/parseDouble ?value))]))) + (&lexer/$Dec ?value) + (return (&/|list (&/T [meta (&/$Dec (Double/parseDouble ?value))]))) (&lexer/$Text ?value) (return (&/|list (&/T [meta (&/$Text ?value)]))) diff --git a/lux-bootstrapper/src/lux/type.clj b/lux-bootstrapper/src/lux/type.clj index 2fc0153a1b..a6bf13f66c 100644 --- a/lux-bootstrapper/src/lux/type.clj +++ b/lux-bootstrapper/src/lux/type.clj @@ -44,7 +44,7 @@ (def Nat (&/$Named (&/T [&/prelude "Nat"]) (&/$Nominal "#I64" (&/|list (&/$Nominal &&host/nat-data-tag &/$End))))) (def Int (&/$Named (&/T [&/prelude "Int"]) (&/$Nominal "#I64" (&/|list (&/$Nominal &&host/int-data-tag &/$End))))) (def Rev (&/$Named (&/T [&/prelude "Rev"]) (&/$Nominal "#I64" (&/|list (&/$Nominal &&host/rev-data-tag &/$End))))) -(def Frac (&/$Named (&/T [&/prelude "Frac"]) (&/$Nominal "#Frac" &/$End))) +(def Dec (&/$Named (&/T [&/prelude "Dec"]) (&/$Nominal "#Dec" &/$End))) (def Text (&/$Named (&/T [&/prelude "Text"]) (&/$Nominal "#Text" &/$End))) (def Symbol (&/$Named (&/T [&/prelude "Symbol"]) (&/$Product Text Text))) diff --git a/lux-bootstrapper/src/lux/type/host.clj b/lux-bootstrapper/src/lux/type/host.clj index 27e1aa6534..5ba67d4fae 100644 --- a/lux-bootstrapper/src/lux/type/host.clj +++ b/lux-bootstrapper/src/lux/type/host.clj @@ -329,7 +329,7 @@ (def ^:private lux-jvm-type-combos #{#{"java.lang.Boolean" "#Bit"} #{"java.lang.Long" i64-data-tag} - #{"java.lang.Double" "#Frac"} + #{"java.lang.Double" "#Dec"} #{"java.lang.String" "#Text"}}) (defn ^:private lux-type? [^String class-name] diff --git a/lux-mode/lux-mode.el b/lux-mode/lux-mode.el index ca7ab601d0..53d62a2e85 100644 --- a/lux-mode/lux-mode.el +++ b/lux-mode/lux-mode.el @@ -358,7 +358,7 @@ Called by `imenu--generic-function'." (integer (concat sign natural)) (bitRE (literal (altRE "#0" "#1"))) (natRE (literal natural)) - (int&fracRE (literal (concat integer "\\(\\." natural "\\(\\(e\\|E\\)" integer "\\)?\\)?"))) + (int&decRE (literal (concat integer "\\(\\." natural "\\(\\(e\\|E\\)" integer "\\)?\\)?"))) (revRE (literal (concat "\\." natural))) (specialRE (let (;; Control (control//flow (altRE "when" "exec" "let" "cond" "loop" "do" "be" @@ -458,7 +458,7 @@ Called by `imenu--generic-function'." (labelRE (concat global_prefix (+class identifier_h|label) (-class identifier_t) "+")) (literalRE (altRE bitRE ;; Bit literals natRE ;; Nat literals - int&fracRE ;; Int literals && Frac literals + int&decRE ;; Int literals && Dec literals revRE ;; Rev literals ))) `(;; Special forms diff --git a/stdlib/source/documentation/lux.lux b/stdlib/source/documentation/lux.lux index bd9f226ae3..971e8436f3 100644 --- a/stdlib/source/documentation/lux.lux +++ b/stdlib/source/documentation/lux.lux @@ -64,8 +64,8 @@ (format "Fractional numbers that live in the interval [0,1)." \n "Useful for probability, and other domains that work within that interval.")) - ($.definition /.Frac - "Your standard, run-of-the-mill floating-point (fractional) numbers.") + ($.definition /.Dec + "Your standard, run-of-the-mill floating-point (decimal) numbers.") ($.definition /.Text "Your standard, run-of-the-mill string values.") @@ -709,7 +709,7 @@ [bit #1 "#1"] [int +123 "+123"] - [frac +123.0 "+123.0"] + [dec +123.0 "+123.0"] [text "123" "'123'"] [symbol ["yolo" "lol"] "yolo.lol"] [form (list (bit #1)) "(#1)"] @@ -725,7 +725,7 @@ \n "* Nat" \n "* Int" \n "* Rev" - \n "* Frac" + \n "* Dec" \n "* Text") ($.example (' (the my_nat 123))) ($.example (' (the my_text "456"))) diff --git a/stdlib/source/documentation/lux/control/concatenative.lux b/stdlib/source/documentation/lux/control/concatenative.lux index 14ef436836..db957c6e44 100644 --- a/stdlib/source/documentation/lux/control/concatenative.lux +++ b/stdlib/source/documentation/lux/control/concatenative.lux @@ -15,7 +15,7 @@ ["n" nat] ["i" int] ["r" rev] - ["f" frac]]] + ["d" dec]]] [meta [macro ["[0]" template]]]]] @@ -61,16 +61,16 @@ [Rev r/> r.>] [Rev r/>= r.>=] - [Frac f/+ f.+] - [Frac f/- f.-] - [Frac f/* f.*] - [Frac f// f./] - [Frac f/% f.%] - [Frac f/= f.=] - [Frac f/< f.<] - [Frac f/<= f.<=] - [Frac f/> f.>] - [Frac f/>= f.>=] + [Dec f/+ d.+] + [Dec f/- d.-] + [Dec f/* d.*] + [Dec f// d./] + [Dec f/% d.%] + [Dec f/= d.=] + [Dec f/< d.<] + [Dec f/<= d.<=] + [Dec f/> d.>] + [Dec f/>= d.>=] )) ))) diff --git a/stdlib/source/documentation/lux/data/binary.lux b/stdlib/source/documentation/lux/data/binary.lux index d8fbb65db9..8fe838fa4f 100644 --- a/stdlib/source/documentation/lux/data/binary.lux +++ b/stdlib/source/documentation/lux/data/binary.lux @@ -28,7 +28,7 @@ ($.definition \\parser.nat) ($.definition \\parser.int) ($.definition \\parser.rev) - ($.definition \\parser.frac) + ($.definition \\parser.dec) ($.definition \\parser.invalid_tag) ($.definition \\parser.or) ($.definition \\parser.not_a_bit) @@ -129,7 +129,7 @@ ($.definition \\format.nat) ($.definition \\format.int) ($.definition \\format.rev) - ($.definition \\format.frac) + ($.definition \\format.dec) ($.definition \\format.binary_8) ($.definition \\format.binary_16) ($.definition \\format.binary_32) diff --git a/stdlib/source/documentation/lux/data/text.lux b/stdlib/source/documentation/lux/data/text.lux index cae76ee259..af0a237c7e 100644 --- a/stdlib/source/documentation/lux/data/text.lux +++ b/stdlib/source/documentation/lux/data/text.lux @@ -28,7 +28,7 @@ ($.definition \\format.nat) ($.definition \\format.int) ($.definition \\format.rev) - ($.definition \\format.frac) + ($.definition \\format.dec) ($.definition \\format.text) ($.definition \\format.ratio) @@ -58,10 +58,10 @@ ($.definition \\format.rev_8) ($.definition \\format.rev_10) ($.definition \\format.rev_16) - ($.definition \\format.frac_2) - ($.definition \\format.frac_8) - ($.definition \\format.frac_10) - ($.definition \\format.frac_16))] + ($.definition \\format.dec_2) + ($.definition \\format.dec_8) + ($.definition \\format.dec_10) + ($.definition \\format.dec_16))] (list.partial ($.module \\format._ "") diff --git a/stdlib/source/documentation/lux/ffi.js.lux b/stdlib/source/documentation/lux/ffi.js.lux index 97d9b368d9..3a084f5c13 100644 --- a/stdlib/source/documentation/lux/ffi.js.lux +++ b/stdlib/source/documentation/lux/ffi.js.lux @@ -58,7 +58,7 @@ ($.definition /.global "Allows using definitions from the JavaScript host platform." - ($.example (' (global .Frac [Math PI])))) + ($.example (' (global .Dec [Math PI])))) ($.definition /.function (format "Allows defining closures/anonymous-functions in the form that JavaScript expects." diff --git a/stdlib/source/documentation/lux/math/number.lux b/stdlib/source/documentation/lux/math/number.lux index c3ed12d177..2ee0bb1600 100644 --- a/stdlib/source/documentation/lux/math/number.lux +++ b/stdlib/source/documentation/lux/math/number.lux @@ -20,7 +20,7 @@ ["[1][0]" nat] ["[1][0]" int] ["[1][0]" rev] - ["[1][0]" frac] + ["[1][0]" dec] ["[1][0]" ratio] ["[1][0]" complex]]) @@ -31,7 +31,7 @@ (,, (with_template [ ] [($.definition - (format "Given syntax for a " " number, generates a Nat, an Int, a Rev or a Frac.") + (format "Given syntax for a " " number, generates a Nat, an Int, a Rev or a Dec.") ($.example (' )) ($.comment "Allows for the presence of commas (,) among the digits.") @@ -50,7 +50,7 @@ /nat.documentation /int.documentation /rev.documentation - /frac.documentation + /dec.documentation /ratio.documentation /complex.documentation ) diff --git a/stdlib/source/documentation/lux/math/number/frac.lux b/stdlib/source/documentation/lux/math/number/dec.lux similarity index 86% rename from stdlib/source/documentation/lux/math/number/frac.lux rename to stdlib/source/documentation/lux/math/number/dec.lux index 4e69a4533b..991b698e6b 100644 --- a/stdlib/source/documentation/lux/math/number/frac.lux +++ b/stdlib/source/documentation/lux/math/number/dec.lux @@ -95,34 +95,34 @@ ($.definition /.hash) ($.definition /.= - "Frac(tion) equivalence." + "Dec(tion) equivalence." ($.example (' (= expected actual)))) ($.definition /.< - "Frac(tion) less-than." + "Dec(tion) less-than." ($.example (' (< reference it)))) ($.definition /.<= - "Frac(tion) less-than or equal." + "Dec(tion) less-than or equal." ($.example (' (<= reference it)))) ($.definition /.> - "Frac(tion) greater-than." + "Dec(tion) greater-than." ($.example (' (> reference it)))) ($.definition /.>= - "Frac(tion) greater-than or equal." + "Dec(tion) greater-than or equal." ($.example (' (>= reference it)))) (,, (with_template [ ] [($.definition )] - [/.+ "Frac(tion) addition."] - [/.- "Frac(tion) substraction."] - [/.* "Frac(tion) multiplication."] - [/./ "Frac(tion) division."] - [/.% "Frac(tion) remainder."] + [/.+ "Dec(tion) addition."] + [/.- "Dec(tion) substraction."] + [/.* "Dec(tion) multiplication."] + [/./ "Dec(tion) division."] + [/.% "Dec(tion) remainder."] )) ($.definition /./% @@ -133,8 +133,8 @@ [($.definition )] - [/.min "Frac(tion) minimum."] - [/.max "Frac(tion) minimum."] + [/.min "Dec(tion) minimum."] + [/.max "Dec(tion) minimum."] )) (,, (with_template [ ] @@ -147,7 +147,7 @@ )) ($.definition /.not_a_number? - "Tests whether a frac is actually not-a-number." + "Tests whether a Dec is actually not-a-number." ($.example (' (not_a_number? it)))) ($.definition /.approximately? diff --git a/stdlib/source/documentation/lux/math/number/int.lux b/stdlib/source/documentation/lux/math/number/int.lux index 691bcb4d01..6912694686 100644 --- a/stdlib/source/documentation/lux/math/number/int.lux +++ b/stdlib/source/documentation/lux/math/number/int.lux @@ -22,7 +22,7 @@ ($.definition /.even?) ($.definition /.odd?) ($.definition /.co_prime?) - ($.definition /.frac) + ($.definition /.dec) ($.definition /.equivalence) ($.definition /.order) ($.definition /.enum) diff --git a/stdlib/source/documentation/lux/math/number/nat.lux b/stdlib/source/documentation/lux/math/number/nat.lux index 85e8468d1c..0471b92613 100644 --- a/stdlib/source/documentation/lux/math/number/nat.lux +++ b/stdlib/source/documentation/lux/math/number/nat.lux @@ -19,7 +19,7 @@ ($.definition /.co_prime?) ($.definition /.even?) ($.definition /.odd?) - ($.definition /.frac) + ($.definition /.dec) ($.definition /.equivalence) ($.definition /.order) ($.definition /.enum) diff --git a/stdlib/source/documentation/lux/math/number/rev.lux b/stdlib/source/documentation/lux/math/number/rev.lux index 733e8d7217..95adc646a0 100644 --- a/stdlib/source/documentation/lux/math/number/rev.lux +++ b/stdlib/source/documentation/lux/math/number/rev.lux @@ -30,7 +30,7 @@ ($.definition /./2048) ($.definition /./4096) ($.definition /./%) - ($.definition /.frac) + ($.definition /.dec) ($.definition /.equivalence) ($.definition /.hash) ($.definition /.order) diff --git a/stdlib/source/documentation/lux/math/random.lux b/stdlib/source/documentation/lux/math/random.lux index 0ed59a8833..7e6b3b3ea5 100644 --- a/stdlib/source/documentation/lux/math/random.lux +++ b/stdlib/source/documentation/lux/math/random.lux @@ -20,10 +20,10 @@ ($.definition /.nat) ($.definition /.int) ($.definition /.rev) - ($.definition /.frac) + ($.definition /.dec) ($.definition /.char) - ($.definition /.safe_frac + ($.definition /.safe_dec "A number in the interval [0.0,1.0].")) text (list ($.definition /.unicode) ($.definition /.ascii) diff --git a/stdlib/source/documentation/lux/meta/code.lux b/stdlib/source/documentation/lux/meta/code.lux index a8d09512e6..2c8ce4567f 100644 --- a/stdlib/source/documentation/lux/meta/code.lux +++ b/stdlib/source/documentation/lux/meta/code.lux @@ -38,7 +38,7 @@ [\\parser.nat \\parser.this_nat] [\\parser.int \\parser.this_int] [\\parser.rev \\parser.this_rev] - [\\parser.frac \\parser.this_frac] + [\\parser.dec \\parser.this_dec] [\\parser.text \\parser.this_text] [\\parser.symbol \\parser.this_symbol] )) @@ -96,7 +96,7 @@ ($.definition /.nat) ($.definition /.int) ($.definition /.rev) - ($.definition /.frac) + ($.definition /.dec) ($.definition /.text) ($.definition /.symbol) ($.definition /.form) diff --git a/stdlib/source/documentation/lux/meta/compiler/language/lux/analysis.lux b/stdlib/source/documentation/lux/meta/compiler/language/lux/analysis.lux index f1e39d1c72..4737d6ccb6 100644 --- a/stdlib/source/documentation/lux/meta/compiler/language/lux/analysis.lux +++ b/stdlib/source/documentation/lux/meta/compiler/language/lux/analysis.lux @@ -51,7 +51,7 @@ [\\parser.nat \\parser.this_nat] [\\parser.int \\parser.this_int] [\\parser.rev \\parser.this_rev] - [\\parser.frac \\parser.this_frac] + [\\parser.dec \\parser.this_dec] [\\parser.text \\parser.this_text] [\\parser.local \\parser.this_local] [\\parser.foreign \\parser.this_foreign] @@ -81,7 +81,7 @@ ($.definition /.nat) ($.definition /.int) ($.definition /.rev) - ($.definition /.frac) + ($.definition /.dec) ($.definition /.text) ($.definition /.no_op) ($.definition /.variable) diff --git a/stdlib/source/documentation/lux/meta/static.lux b/stdlib/source/documentation/lux/meta/static.lux index 5887bc83c8..b0a151a211 100644 --- a/stdlib/source/documentation/lux/meta/static.lux +++ b/stdlib/source/documentation/lux/meta/static.lux @@ -24,7 +24,7 @@ [/.nat .Nat] [/.int .Int] [/.rev .Rev] - [/.frac .Frac] + [/.dec .Dec] [/.text .Text] )) @@ -43,7 +43,7 @@ [/.random_nat .Nat] [/.random_int .Int] [/.random_rev .Rev] - [/.random_frac .Frac] + [/.random_dec .Dec] )) ($.definition /.random diff --git a/stdlib/source/documentation/lux/meta/type.lux b/stdlib/source/documentation/lux/meta/type.lux index c1bdfeed9c..50e0a43390 100644 --- a/stdlib/source/documentation/lux/meta/type.lux +++ b/stdlib/source/documentation/lux/meta/type.lux @@ -266,7 +266,7 @@ ($.definition /.let "Local bindings for types." - ($.example (' (let [side (Either Int Frac)] + ($.example (' (let [side (Either Int Dec)] (List [side side]))))) ... ($.definition /.literal diff --git a/stdlib/source/format/lux/data/binary.lux b/stdlib/source/format/lux/data/binary.lux index be023bd8dd..05d4d6f49c 100644 --- a/stdlib/source/format/lux/data/binary.lux +++ b/stdlib/source/format/lux/data/binary.lux @@ -29,7 +29,7 @@ [number ["n" nat] ["[0]" i64] - ["[0]" frac]]] + ["[0]" dec]]] [meta [macro ["^" pattern]]] @@ -157,9 +157,9 @@ [rev Rev] ) -(the .public frac - (Format Frac) - (|>> frac.bits +(the .public dec + (Format Dec) + (|>> dec.bits ..bits_64)) (the .public (segment size) @@ -330,7 +330,7 @@ [1 .#Nat ..nat] [2 .#Int ..int] [3 .#Rev ..rev] - [4 .#Frac ..frac] + [4 .#Dec ..dec] [5 .#Text ..text] [6 .#Symbol ..symbol] [7 .#Form sequence] diff --git a/stdlib/source/format/lux/data/text.lux b/stdlib/source/format/lux/data/text.lux index cae583047f..e9075a3132 100644 --- a/stdlib/source/format/lux/data/text.lux +++ b/stdlib/source/format/lux/data/text.lux @@ -24,7 +24,7 @@ ["[0]" nat] ["[0]" int] ["[0]" rev] - ["[0]" frac] + ["[0]" dec] ["[0]" ratio] ["[0]" complex]] [arithmetic @@ -69,7 +69,7 @@ [nat Nat (of nat.decimal encoded)] [int Int (of int.decimal encoded)] [rev Rev (of rev.decimal encoded)] - [frac Frac (of frac.decimal encoded)] + [dec Dec (of dec.decimal encoded)] [text Text text.format] [ratio ratio.Ratio (of ratio.codec encoded)] @@ -93,13 +93,13 @@ (with_template [] [(the .public - (Format Frac) + (Format Dec) (let [suffix (|> +0.0 - (of (template.symbol [frac._] []) encoded) + (of (template.symbol [dec._] []) encoded) (text.clip_since 4) (maybe.else ""))] - (|>> ((template.symbol [frac._] [as_ ])) - frac.int + (|>> ((template.symbol [dec._] [as_ ])) + dec.int ..int (text.suffix suffix))))] @@ -132,11 +132,11 @@ [rev_8 rev.octal] [rev_10 rev.decimal] [rev_16 rev.hex]]] - [Frac - [[frac_2 frac.binary] - [frac_8 frac.octal] - [frac_10 frac.decimal] - [frac_16 frac.hex]]] + [Dec + [[dec_2 dec.binary] + [dec_8 dec.octal] + [dec_10 dec.decimal] + [dec_16 dec.hex]]] ) (the .public (padded padding format) diff --git a/stdlib/source/library/lux.lux b/stdlib/source/library/lux.lux index a0a039b565..71c053e32c 100644 --- a/stdlib/source/library/lux.lux +++ b/stdlib/source/library/lux.lux @@ -68,11 +68,11 @@ {#0 "#I64" {#1 {#0 "#Rev" {#0}} {#0}}}}) #1) -(.def# Frac +(.def# Dec (.is_type# {9 #1 - [..prelude "Frac"] - {#0 "#Frac" {#0}}}) + [..prelude "Dec"] + {#0 "#Dec" {#0}}}) #1) (.def# Text @@ -346,7 +346,7 @@ ... {#Nat Nat} ... {#Int Int} ... {#Rev Rev} -... {#Frac Frac} +... {#Dec Dec} ... {#Text Text} ... {#Symbol Symbol} ... {#Form (List (w (Code' w)))} @@ -371,8 +371,8 @@ ... Rev Rev {#Sum - ... Frac - Frac + ... Dec + Dec {#Sum ... Text Text @@ -402,7 +402,7 @@ {#Item [..prelude "#Nat"] {#Item [..prelude "#Int"] {#Item [..prelude "#Rev"] - {#Item [..prelude "#Frac"] + {#Item [..prelude "#Dec"] {#Item [..prelude "#Text"] {#Item [..prelude "#Symbol"] {#Item [..prelude "#Form"] @@ -414,7 +414,7 @@ (.def# #Nat (tag [{#Some [1 #0 ..code'_tags]} Code']) #1) (.def# #Int (tag [{#Some [2 #0 ..code'_tags]} Code']) #1) (.def# #Rev (tag [{#Some [3 #0 ..code'_tags]} Code']) #1) -(.def# #Frac (tag [{#Some [4 #0 ..code'_tags]} Code']) #1) +(.def# #Dec (tag [{#Some [4 #0 ..code'_tags]} Code']) #1) (.def# #Text (tag [{#Some [5 #0 ..code'_tags]} Code']) #1) (.def# #Symbol (tag [{#Some [6 #0 ..code'_tags]} Code']) #1) (.def# #Form (tag [{#Some [7 #0 ..code'_tags]} Code']) #1) @@ -478,10 +478,10 @@ ([_ value] (_ann {#Rev value}))) #0) -(.def# as_frac - (.is# {#Function Frac +(.def# as_dec + (.is# {#Function Dec Code} - ([_ value] (_ann {#Frac value}))) + ([_ value] (_ann {#Dec value}))) #0) (.def# as_text @@ -2319,9 +2319,9 @@ (meta#in (with_location ..location#dummy (as_variant (list (as_symbol [..prelude "#Rev"]) (as_rev value))))) - [_ [@token {#Frac value}]] + [_ [@token {#Dec value}]] (meta#in (with_location ..location#dummy - (as_variant (list (as_symbol [..prelude "#Frac"]) (as_frac value))))) + (as_variant (list (as_symbol [..prelude "#Dec"]) (as_dec value))))) [_ [@token {#Text value}]] (meta#in (untemplated_text value)) @@ -2779,8 +2779,8 @@ (|> value (.int_/# +10) int#abs) (|> value (.int_%# +10) int#abs (.as# Nat) digit::format))))) -(def' .private (frac#encoded x) - (-> Frac +(def' .private (dec#encoded x) + (-> Dec Text) (.f64_encoded# x)) @@ -2870,8 +2870,8 @@ [_ {#Rev value}] (.error# "@code#encoded Undefined behavior.") - [_ {#Frac value}] - (frac#encoded value) + [_ {#Dec value}] + (dec#encoded value) [_ {#Text value}] (text#encoded value) @@ -3387,8 +3387,8 @@ ({{#Nominal "#Bit" {#End}} (in (as_bit (as Bit value))) - {#Nominal "#Frac" {#End}} - (in (as_frac (as Frac value))) + {#Nominal "#Dec" {#End}} + (in (as_dec (as Dec value))) {#Nominal "#Text" {#End}} (in (as_text (as Text value))) @@ -5704,7 +5704,7 @@ [_ {#Nat _}] [_ {#Int _}] [_ {#Rev _}] - [_ {#Frac _}] + [_ {#Dec _}] [_ {#Text _}]) (list target) @@ -6205,7 +6205,7 @@ (failure ..wrong_syntax)))) (alias [F64 Double] - ..Frac) + ..Dec) (alias [alias?] ..same?) diff --git a/stdlib/source/library/lux/algorithm/size.lux b/stdlib/source/library/lux/algorithm/size.lux new file mode 100644 index 0000000000..2d67742c1b --- /dev/null +++ b/stdlib/source/library/lux/algorithm/size.lux @@ -0,0 +1,71 @@ +... This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +... If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + +(.require + [library + [lux (.except left right) + [control + ["[0]" function]] + [math + [number + ["n" nat]]]]]) + +(every .public (Size ! of) + (-> (! of) + Nat)) + +(every .public (Constant it) + (All (_ of) + it)) + +(the .public constant + (All (_ it) + (Size (Constant it))) + (function.constant 0)) + +(every .public Variable + (All (_ of) + of)) + +(the .public variable + (Size Variable) + (function.constant 1)) + +(every .public (Sum left right) + (All (_ of) + (Or (left of) + (right of)))) + +(the .public (sum left right) + (All (_ left right) + (-> (Size left) (Size right) + (Size (Sum left right)))) + (function (_ it) + (when it + {#0 it} (left it) + {#1 it} (right it)))) + +(every .public (Product left right) + (All (_ of) + (And (left of) + (right of)))) + +(the .public (product left right) + (All (_ left right) + (-> (Size left) (Size right) + (Size (Product left right)))) + (function (_ [itL itR]) + (n.+ (left itL) + (right itR)))) + +(every .public (Recursive it) + (All (self of) + (it self of))) + +(the .public (recursive size) + (All (_ of) + (-> (-> (Size of) + (Size of)) + (Size of))) + (function (recursion value) + (size recursion value))) diff --git a/stdlib/source/library/lux/control/concatenative.lux b/stdlib/source/library/lux/control/concatenative.lux index 024db2ff39..efce990046 100644 --- a/stdlib/source/library/lux/control/concatenative.lux +++ b/stdlib/source/library/lux/control/concatenative.lux @@ -3,7 +3,8 @@ (.require [library - [lux (.except Alias if loop left right) + [lux (.except Alias + if loop left right) [abstract ["[0]" monad]] [control @@ -19,7 +20,7 @@ ["n" nat] ["i" int] ["r" rev] - ["f" frac]]] + ["d" dec]]] ["[0]" meta (.only) ["[0]" type] ["[0]" code (.only) @@ -189,16 +190,16 @@ [Rev Bit r/> r.>] [Rev Bit r/>= r.>=] - [Frac Frac f/+ f.+] - [Frac Frac f/- f.-] - [Frac Frac f/* f.*] - [Frac Frac f// f./] - [Frac Frac f/% f.%] - [Frac Bit f/= f.=] - [Frac Bit f/< f.<] - [Frac Bit f/<= f.<=] - [Frac Bit f/> f.>] - [Frac Bit f/>= f.>=] + [Dec Dec f/+ d.+] + [Dec Dec f/- d.-] + [Dec Dec f/* d.*] + [Dec Dec f// d./] + [Dec Dec f/% d.%] + [Dec Bit f/= d.=] + [Dec Bit f/< d.<] + [Dec Bit f/<= d.<=] + [Dec Bit f/> d.>] + [Dec Bit f/>= d.>=] ) (the .public if diff --git a/stdlib/source/library/lux/control/concurrency/thread.lux b/stdlib/source/library/lux/control/concurrency/thread.lux index 51ff80a76a..94aa81d112 100644 --- a/stdlib/source/library/lux/control/concurrency/thread.lux +++ b/stdlib/source/library/lux/control/concurrency/thread.lux @@ -18,7 +18,7 @@ [math [number ["n" nat] - ["f" frac]]] + ["d" dec]]] [meta ["[0]" configuration]] [world @@ -153,12 +153,12 @@ .js (..setTimeout [(ffi.function (_ []) Any (..execute! action)) - (n.frac milli_seconds)]) + (n.dec milli_seconds)]) .python (do io.monad [_ (|> (ffi.function (_ []) Any (..execute! action)) - [(|> milli_seconds n.frac (f./ +1,000.0))] + [(|> milli_seconds n.dec (d./ +1,000.0))] threading::Timer (threading/Timer::start []))] (in [])) diff --git a/stdlib/source/library/lux/control/logic.lux b/stdlib/source/library/lux/control/logic.lux index 4126247b39..fc2572a1b9 100644 --- a/stdlib/source/library/lux/control/logic.lux +++ b/stdlib/source/library/lux/control/logic.lux @@ -23,7 +23,7 @@ ["[0]" nat] ["[0]" int] ["[0]" rev] - ["[0]" frac]]] + ["[0]" dec]]] [meta [type ["[0]" nominal] @@ -43,9 +43,9 @@ (Equivalence Rev) rev.equivalence) -(the .public frac - (Equivalence Frac) - frac.equivalence) +(the .public dec + (Equivalence Dec) + dec.equivalence) (the .public text (Equivalence Text) diff --git a/stdlib/source/library/lux/control/pattern.lux b/stdlib/source/library/lux/control/pattern.lux index a247b88026..7c89a45aa3 100644 --- a/stdlib/source/library/lux/control/pattern.lux +++ b/stdlib/source/library/lux/control/pattern.lux @@ -27,7 +27,7 @@ ["[0]" nat] ["[0]" int] ["[0]" rev] - ["[0]" frac]]] + ["[0]" dec]]] [meta ["[0]" type] [macro @@ -279,7 +279,7 @@ [Nat nat nat.equivalence] [Int int int.equivalence] [Rev rev rev.equivalence] - [Frac frac frac.equivalence] + [Dec dec dec.equivalence] [Text text text.equivalence] ) diff --git a/stdlib/source/library/lux/data/color/cmyk.lux b/stdlib/source/library/lux/data/color/cmyk.lux index 0727f523d7..313c2de7d4 100644 --- a/stdlib/source/library/lux/data/color/cmyk.lux +++ b/stdlib/source/library/lux/data/color/cmyk.lux @@ -13,13 +13,13 @@ ["[0]" product]] [math [number - ["f" frac] + ["d" dec] ["[0]" int]]]]] [// ["[0]" rgb (.only RGB)]]) (every .public Value - Frac) + Dec) (with_template [ ] [(the .public @@ -31,15 +31,15 @@ ) (the .public (value? it) - (Predicate Frac) - (not (or (f.< ..least it) - (f.> ..most it)))) + (Predicate Dec) + (not (or (d.< ..least it) + (d.> ..most it)))) (the .public value - (-> Frac + (-> Dec Value) - (|>> (f.max ..least) - (f.min ..most))) + (|>> (d.max ..least) + (d.min ..most))) (every .public CMYK (Record @@ -51,32 +51,32 @@ (the .public equivalence (Equivalence CMYK) (all product.equivalence - f.equivalence - f.equivalence - f.equivalence - f.equivalence + d.equivalence + d.equivalence + d.equivalence + d.equivalence )) (the top (-- rgb.limit)) (the rgb_factor - (|> top .int int.frac)) + (|> top .int int.dec)) (the down (-> Nat - Frac) - (|>> .int int.frac (f./ rgb_factor))) + Dec) + (|>> .int int.dec (d./ rgb_factor))) (the up - (-> Frac + (-> Dec Nat) - (|>> (f.* rgb_factor) f.round f.int .nat)) + (|>> (d.* rgb_factor) d.round d.int .nat)) (the (opposite it) - (-> Frac - Frac) - (f.- it ..most)) + (-> Dec + Dec) + (d.- it ..most)) (the .public (of_rgb it) (-> RGB @@ -84,14 +84,14 @@ (let [red (..down (rgb.red it)) green (..down (rgb.green it)) blue (..down (rgb.blue it)) - key (opposite (all f.max red green blue)) - f (if (f.< ..most key) - (f./ (opposite key) + key (opposite (all d.max red green blue)) + f (if (d.< ..most key) + (d./ (opposite key) ..most) ..least)] - [#cyan (|> ..most (f.- red) (f.- key) (f.* f)) - #magenta (|> ..most (f.- green) (f.- key) (f.* f)) - #yellow (|> ..most (f.- blue) (f.- key) (f.* f)) + [#cyan (|> ..most (d.- red) (d.- key) (d.* f)) + #magenta (|> ..most (d.- green) (d.- key) (d.* f)) + #yellow (|> ..most (d.- blue) (d.- key) (d.* f)) #key key])) (the .public (rgb it) @@ -103,6 +103,6 @@ key (let [~key (opposite key)] - (rgb.rgb (..up (f.* ~key (opposite (its #cyan it)))) - (..up (f.* ~key (opposite (its #magenta it)))) - (..up (f.* ~key (opposite (its #yellow it)))))))) + (rgb.rgb (..up (d.* ~key (opposite (its #cyan it)))) + (..up (d.* ~key (opposite (its #magenta it)))) + (..up (d.* ~key (opposite (its #yellow it)))))))) diff --git a/stdlib/source/library/lux/data/color/hsb.lux b/stdlib/source/library/lux/data/color/hsb.lux index aa7819849f..9e5264c51f 100644 --- a/stdlib/source/library/lux/data/color/hsb.lux +++ b/stdlib/source/library/lux/data/color/hsb.lux @@ -14,7 +14,7 @@ ["%" \\format]]] [math [number - ["f" frac] + ["d" dec] ["[0]" nat] ["[0]" int]]] [meta @@ -26,7 +26,7 @@ ["[0]" rgb (.only RGB)]]) (every .public Value - Frac) + Dec) (with_template [ ] [(the .public @@ -38,15 +38,15 @@ ) (the .public (value? it) - (Predicate Frac) - (not (or (f.< ..least it) - (f.> ..most it)))) + (Predicate Dec) + (not (or (d.< ..least it) + (d.> ..most it)))) (the .public value - (-> Frac + (-> Dec Value) - (|>> (f.max ..least) - (f.min ..most))) + (|>> (d.max ..least) + (d.min ..most))) (nominal.every .public HSB (Record @@ -59,7 +59,7 @@ (implementation (the (= left right) (`` (and (,, (with_template [] - [(f.= (its (nominal.representation left)) + [(d.= (its (nominal.representation left)) (its (nominal.representation right)))] [#hue] @@ -80,7 +80,7 @@ ) (the .public (hsb hue saturation brightness) - (-> Frac Frac Frac + (-> Dec Dec Dec HSB) (nominal.abstraction [#hue (..value hue) @@ -91,17 +91,17 @@ (-- rgb.limit)) (the rgb_factor - (|> top .int int.frac)) + (|> top .int int.dec)) (the down (-> Nat - Frac) - (|>> nat.frac (f./ rgb_factor))) + Dec) + (|>> nat.dec (d./ rgb_factor))) (the up - (-> Frac + (-> Dec Nat) - (|>> (f.* rgb_factor) f.round f.int .nat)) + (|>> (d.* rgb_factor) d.round d.int .nat)) (the .public (of_rgb it) (-> RGB @@ -110,31 +110,31 @@ green (..down (rgb.green it)) blue (..down (rgb.blue it)) - brightness (all f.max red green blue) - range (all f.min red green blue) + brightness (all d.max red green blue) + range (all d.min red green blue) - chroma (|> brightness (f.- range)) - saturation (if (f.= +0.0 brightness) + chroma (|> brightness (d.- range)) + saturation (if (d.= +0.0 brightness) +0.0 - (|> chroma (f./ brightness)))] + (|> chroma (d./ brightness)))] (macro.let [hue_of (template (_ ) - [(|> (f.- ) - (f./ chroma) + [(|> (d.- ) + (d./ chroma) - (f./ +6.0))])] + (d./ +6.0))])] (nominal.abstraction - [#hue (cond (f.= +0.0 chroma) + [#hue (cond (d.= +0.0 chroma) ... Achromatic +0.0 ... Chromatic - (f.= brightness red) - (hue_of green blue (f.mod +6.0)) + (d.= brightness red) + (hue_of green blue (d.mod +6.0)) - (f.= brightness green) - (hue_of blue red (f.+ +2.0)) + (d.= brightness green) + (hue_of blue red (d.+ +2.0)) - ... (f.= brightness blue) - (hue_of red green (f.+ +4.0))) + ... (d.= brightness blue) + (hue_of red green (d.+ +4.0))) #saturation saturation #brightness brightness])))) @@ -142,15 +142,15 @@ (-> HSB RGB) (let [[hue saturation brightness] (nominal.representation it) - hue (|> hue (f.* +6.0)) + hue (|> hue (d.* +6.0)) - i (f.floor hue) - f (|> hue (f.- i)) - p (|> +1.0 (f.- saturation) (f.* brightness)) - q (|> +1.0 (f.- (f.* f saturation)) (f.* brightness)) - t (|> +1.0 (f.- (|> +1.0 (f.- f) (f.* saturation))) (f.* brightness)) + i (d.floor hue) + f (|> hue (d.- i)) + p (|> +1.0 (d.- saturation) (d.* brightness)) + q (|> +1.0 (d.- (d.* f saturation)) (d.* brightness)) + t (|> +1.0 (d.- (|> +1.0 (d.- f) (d.* saturation))) (d.* brightness)) v brightness - mod (|> i (f.% +6.0) f.int .nat) + mod (|> i (d.% +6.0) d.int .nat) red (when mod 0 v 1 q 2 p 3 p 4 t 5 v _ (undefined)) green (when mod 0 t 1 v 2 v 3 q 4 p 5 p _ (undefined)) @@ -163,8 +163,8 @@ (%.Format HSB) (let [it (nominal.representation it)] (%.format "hsb(" - (%.nat (f.nat (f.as_degree (its #hue it)))) - " " (%.nat (f.nat (f.as_percentage (its #saturation it)))) "%" - " " (%.nat (f.nat (f.as_percentage (its #brightness it)))) "%" + (%.nat (d.nat (d.as_degree (its #hue it)))) + " " (%.nat (d.nat (d.as_percentage (its #saturation it)))) "%" + " " (%.nat (d.nat (d.as_percentage (its #brightness it)))) "%" ")"))) ) diff --git a/stdlib/source/library/lux/data/color/hsl.lux b/stdlib/source/library/lux/data/color/hsl.lux index c6957135ff..11d83b139d 100644 --- a/stdlib/source/library/lux/data/color/hsl.lux +++ b/stdlib/source/library/lux/data/color/hsl.lux @@ -16,7 +16,7 @@ [math [number ["i" int] - ["f" frac]]]]] + ["d" dec]]]]] [// ["[0]" rgb (.only RGB)]]) @@ -24,20 +24,20 @@ (-- rgb.limit)) (the rgb_factor - (|> top .int i.frac)) + (|> top .int i.dec)) (the down (-> Nat - Frac) - (|>> .int i.frac (f./ rgb_factor))) + Dec) + (|>> .int i.dec (d./ rgb_factor))) (the up - (-> Frac + (-> Dec Nat) - (|>> (f.* rgb_factor) f.round f.int .nat)) + (|>> (d.* rgb_factor) d.round d.int .nat)) (every .public Value - Frac) + Dec) (with_template [ ] [(the .public @@ -49,15 +49,15 @@ ) (the .public (value? it) - (Predicate Frac) - (not (or (f.< ..least it) - (f.> ..most it)))) + (Predicate Dec) + (not (or (d.< ..least it) + (d.> ..most it)))) (the .public value - (-> Frac + (-> Dec Value) - (|>> (f.max ..least) - (f.min ..most))) + (|>> (d.max ..least) + (d.min ..most))) (every .public HSL (Record @@ -70,7 +70,7 @@ (implementation (the (= left right) (`` (and (,, (with_template [] - [(f.= (its left) + [(d.= (its left) (its right))] [#hue] @@ -79,7 +79,7 @@ ))))))) (the .public (hsl hue saturation luminance) - (-> Frac Frac Frac + (-> Dec Dec Dec HSL) [#hue (..value hue) #saturation (..value saturation) @@ -92,51 +92,51 @@ green (..down (rgb.green it)) blue (..down (rgb.blue it)) - max (all f.max red green blue) - min (all f.min red green blue) - luminance (|> (f.+ max min) (f./ +2.0))] - (if (f.= max min) + max (all d.max red green blue) + min (all d.min red green blue) + luminance (|> (d.+ max min) (d./ +2.0))] + (if (d.= max min) ... Achromatic [#hue ..least #saturation ..least #luminance luminance] ... Chromatic - (let [diff (|> max (f.- min)) + (let [diff (|> max (d.- min)) saturation (|> diff - (f./ (if (f.> +0.5 luminance) - (|> +2.0 (f.- max) (f.- min)) - (|> max (f.+ min))))) - hue' (cond (f.= red max) - (|> green (f.- blue) (f./ diff) - (f.+ (if (f.< blue green) +6.0 +0.0))) + (d./ (if (d.> +0.5 luminance) + (|> +2.0 (d.- max) (d.- min)) + (|> max (d.+ min))))) + hue' (cond (d.= red max) + (|> green (d.- blue) (d./ diff) + (d.+ (if (d.< blue green) +6.0 +0.0))) - (f.= green max) - (|> blue (f.- red) (f./ diff) - (f.+ +2.0)) + (d.= green max) + (|> blue (d.- red) (d./ diff) + (d.+ +2.0)) - ... (f.= blue max) - (|> red (f.- green) (f./ diff) - (f.+ +4.0)))] - [#hue (|> hue' (f./ +6.0)) + ... (d.= blue max) + (|> red (d.- green) (d./ diff) + (d.+ +4.0)))] + [#hue (|> hue' (d./ +6.0)) #saturation saturation #luminance luminance])))) (the (hue_rgb p q t) - (-> Frac Frac Frac + (-> Dec Dec Dec Nat) - (let [t (cond (f.< +0.0 t) (f.+ +1.0 t) - (f.> +1.0 t) (f.- +1.0 t) + (let [t (cond (d.< +0.0 t) (d.+ +1.0 t) + (d.> +1.0 t) (d.- +1.0 t) ... else t) - f2/3 (f./ +3.0 +2.0)] - (..up (cond (f.< (f./ +6.0 +1.0) t) - (|> q (f.- p) (f.* +6.0) (f.* t) (f.+ p)) + f2/3 (d./ +3.0 +2.0)] + (..up (cond (d.< (d./ +6.0 +1.0) t) + (|> q (d.- p) (d.* +6.0) (d.* t) (d.+ p)) - (f.< (f./ +2.0 +1.0) t) + (d.< (d./ +2.0 +1.0) t) q - (f.< f2/3 t) - (|> q (f.- p) (f.* (|> f2/3 (f.- t))) (f.* +6.0) (f.+ p)) + (d.< f2/3 t) + (|> q (d.- p) (d.* (|> f2/3 (d.- t))) (d.* +6.0) (d.+ p)) ... else p)))) @@ -144,44 +144,44 @@ (the .public (rgb (open "/[0]")) (-> HSL RGB) - (if (f.= ..least /#saturation) + (if (d.= ..least /#saturation) ... Achromatic (let [intensity (..up /#luminance)] (rgb.rgb intensity intensity intensity)) ... Chromatic - (let [q (if (f.< +0.5 /#luminance) - (|> /#saturation (f.+ +1.0) (f.* /#luminance)) - (|> /#luminance (f.+ /#saturation) (f.- (f.* /#saturation /#luminance)))) - p (|> /#luminance (f.* +2.0) (f.- q)) - third (|> +1.0 (f./ +3.0))] - (rgb.rgb (|> /#hue (f.+ third) (hue_rgb p q)) + (let [q (if (d.< +0.5 /#luminance) + (|> /#saturation (d.+ +1.0) (d.* /#luminance)) + (|> /#luminance (d.+ /#saturation) (d.- (d.* /#saturation /#luminance)))) + p (|> /#luminance (d.* +2.0) (d.- q)) + third (|> +1.0 (d./ +3.0))] + (rgb.rgb (|> /#hue (d.+ third) (hue_rgb p q)) (|> /#hue (hue_rgb p q)) - (|> /#hue (f.- third) (hue_rgb p q)))))) + (|> /#hue (d.- third) (hue_rgb p q)))))) (the (ratio it) - (-> Frac - Frac) - (cond (f.> +1.0 it) - (f.% +1.0 it) + (-> Dec + Dec) + (cond (d.> +1.0 it) + (d.% +1.0 it) - (f.< +0.0 it) - (|> it (f.% +1.0) (f.+ +1.0)) + (d.< +0.0 it) + (|> it (d.% +1.0) (d.+ +1.0)) ... else it)) (with_template [ ] [(the .public ( ratio (open "/[0]")) - (-> Frac HSL + (-> Dec HSL HSL) (..hsl /#hue (|> /#saturation - (f.* (|> +1.0 ( (..ratio ratio)))) - (f.min +1.0)) + (d.* (|> +1.0 ( (..ratio ratio)))) + (d.min +1.0)) /#luminance))] - [f.+ saturated] - [f.- un_saturated] + [d.+ saturated] + [d.- un_saturated] ) (the .public gray_scale @@ -194,7 +194,7 @@ (the .public (format it) (%.Format HSL) (%.format "hsl(" - (%.nat (f.nat (f.as_degree (its #hue it)))) - " " (%.nat (f.nat (f.as_percentage (its #saturation it)))) "%" - " " (%.nat (f.nat (f.as_percentage (its #luminance it)))) "%" + (%.nat (d.nat (d.as_degree (its #hue it)))) + " " (%.nat (d.nat (d.as_percentage (its #saturation it)))) "%" + " " (%.nat (d.nat (d.as_percentage (its #luminance it)))) "%" ")")) diff --git a/stdlib/source/library/lux/data/color/rgb.lux b/stdlib/source/library/lux/data/color/rgb.lux index 64e0aaa46f..f938064f79 100644 --- a/stdlib/source/library/lux/data/color/rgb.lux +++ b/stdlib/source/library/lux/data/color/rgb.lux @@ -20,7 +20,7 @@ [number ["n" nat] ["i" int] - ["f" frac] + ["d" dec] ["[0]" i64]]]]]) (the mask @@ -139,28 +139,28 @@ ) (the (ratio it) - (-> Frac - Frac) - (cond (f.> +1.0 it) - (f.% +1.0 it) + (-> Dec + Dec) + (cond (d.> +1.0 it) + (d.% +1.0 it) - (f.< +0.0 it) - (|> it (f.% +1.0) (f.+ +1.0)) + (d.< +0.0 it) + (|> it (d.% +1.0) (d.+ +1.0)) ... else it)) (the .public (interpolated end ratio start) - (-> RGB Frac RGB + (-> RGB Dec RGB RGB) (let [dS (..ratio ratio) - dE (|> +1.0 (f.- dS)) + dE (|> +1.0 (d.- dS)) interpolated' (is (-> Nat Nat Nat) (function (_ end start) - (|> (|> start .int i.frac (f.* dS)) - (f.+ (|> end .int i.frac (f.* dE))) - f.int + (|> (|> start .int i.dec (d.* dS)) + (d.+ (|> end .int i.dec (d.* dE))) + d.int .nat)))] (..rgb (interpolated' (red end) (red start)) (interpolated' (green end) (green start)) @@ -168,7 +168,7 @@ (with_template [ ] [(the .public - (-> Frac RGB + (-> Dec RGB RGB) (..interpolated ))] diff --git a/stdlib/source/library/lux/data/color/scheme.lux b/stdlib/source/library/lux/data/color/scheme.lux index 3d353652de..0d8a703ff4 100644 --- a/stdlib/source/library/lux/data/color/scheme.lux +++ b/stdlib/source/library/lux/data/color/scheme.lux @@ -10,20 +10,20 @@ [math [number ["i" int] - ["f" frac]]]]] + ["d" dec]]]]] [// [rgb (.only RGB)] ["[0]" hsl] ["[0]" hsb]]) (the (ratio it) - (-> Frac - Frac) - (cond (f.> +1.0 it) - (f.% +1.0 it) + (-> Dec + Dec) + (cond (d.> +1.0 it) + (d.% +1.0 it) - (f.< +0.0 it) - (|> it (f.% +1.0) (f.+ +1.0)) + (d.< +0.0 it) + (|> it (d.% +1.0) (d.+ +1.0)) ... else it)) @@ -34,16 +34,16 @@ [RGB RGB RGB]) (let [(open "/[0]") (hsl.of_rgb it)] [it - (hsl.rgb (hsl.hsl (|> /#hue (f.+ <1>) ..ratio) + (hsl.rgb (hsl.hsl (|> /#hue (d.+ <1>) ..ratio) /#saturation /#luminance)) - (hsl.rgb (hsl.hsl (|> /#hue (f.+ <2>) ..ratio) + (hsl.rgb (hsl.hsl (|> /#hue (d.+ <2>) ..ratio) /#saturation /#luminance))])))] - [triad (|> +1.0 (f./ +3.0)) (|> +2.0 (f./ +3.0))] - [clash (|> +1.0 (f./ +4.0)) (|> +3.0 (f./ +4.0))] - [split_complement (|> +1.0 (f./ +5.0)) (|> +3.0 (f./ +5.0))] + [triad (|> +1.0 (d./ +3.0)) (|> +2.0 (d./ +3.0))] + [clash (|> +1.0 (d./ +4.0)) (|> +3.0 (d./ +4.0))] + [split_complement (|> +1.0 (d./ +5.0)) (|> +3.0 (d./ +5.0))] ) (with_template [ <1> <2> <3>] @@ -56,16 +56,16 @@ (function (_ hue) (hsl.rgb (hsl.hsl hue /#saturation /#luminance))))] [it - (|> /#hue (f.+ <1>) ..ratio of_hue) - (|> /#hue (f.+ <2>) ..ratio of_hue) - (|> /#hue (f.+ <3>) ..ratio of_hue)])))] + (|> /#hue (d.+ <1>) ..ratio of_hue) + (|> /#hue (d.+ <2>) ..ratio of_hue) + (|> /#hue (d.+ <3>) ..ratio of_hue)])))] - [square (|> +1.0 (f./ +4.0)) (|> +2.0 (f./ +4.0)) (|> +3.0 (f./ +4.0))] - [tetradic (|> +2.0 (f./ +12.0)) (|> +6.0 (f./ +12.0)) (|> +8.0 (f./ +12.0))] + [square (|> +1.0 (d./ +4.0)) (|> +2.0 (d./ +4.0)) (|> +3.0 (d./ +4.0))] + [tetradic (|> +2.0 (d./ +12.0)) (|> +6.0 (d./ +12.0)) (|> +8.0 (d./ +12.0))] ) (every .public Spread - Frac) + Dec) ... https://en.wikipedia.org/wiki/Color_scheme (every .public Scheme @@ -80,7 +80,7 @@ luminance (its hsl.#luminance it) spread (..ratio spread)] (list#each (function (_ idx) - (hsl.rgb (hsl.hsl (|> idx ++ .int i.frac (f.* spread) (f.+ hue) ..ratio) + (hsl.rgb (hsl.hsl (|> idx ++ .int i.dec (d.* spread) (d.+ hue) ..ratio) saturation luminance))) (list.indices variations)))) @@ -93,9 +93,9 @@ brightness (hsb.brightness it) spread (..ratio spread)] (|> (list.indices variations) - (list#each (|>> ++ .int i.frac - (f.* spread) - (f.+ brightness) + (list#each (|>> ++ .int i.dec + (d.* spread) + (d.+ brightness) ..ratio (hsb.hsb hue saturation) hsb.rgb))))) diff --git a/stdlib/source/library/lux/data/format/json.lux b/stdlib/source/library/lux/data/format/json.lux index 572812dc29..a40c199a08 100644 --- a/stdlib/source/library/lux/data/format/json.lux +++ b/stdlib/source/library/lux/data/format/json.lux @@ -30,7 +30,7 @@ ["[0]" nat] ["[0]" int] ["[0]" rev] - ["[0]" frac (.use "[1]#[0]" decimal)] + ["[0]" dec (.use "[1]#[0]" decimal)] ["[0]" i64]]] [meta ["[0]" code (.only) @@ -52,7 +52,7 @@ [Null Any] [Boolean Bit] - [Number Frac] + [Number Dec] [String Text] ) @@ -107,7 +107,7 @@ (all <>.or (.form (<>#in [])) .bit - .frac + .dec .text (<>#each sequence.of_list (.tuple (<>.some jsonP))) @@ -127,7 +127,7 @@ [{ value} (` { (, ( value))})]) ([code.bit ..#Boolean' ..#Boolean] - [code.frac ..#Number' ..#Number] + [code.dec ..#Number' ..#Number] [code.text ..#String' ..#String]) {#Array' members} @@ -215,7 +215,7 @@ [[{ x'} { y'}] (of = x' y')]) ([#Boolean bit.equivalence] - [#Number frac.equivalence] + [#Number dec.equivalence] [#String text.equivalence]) [{#Array xs} {#Array ys}] @@ -273,8 +273,8 @@ "0.0" value - (let [raw (of frac.decimal encoded value)] - (if (frac.< +0.0 value) + (let [raw (of dec.decimal encoded value)] + (if (dec.< +0.0 value) raw (|> raw (text.split_at 1) maybe.trusted product.right)))))) @@ -395,7 +395,7 @@ signed?' (<>.parses? (.this "-")) offset (.many .decimal)] (in (all text#composite mark (if signed?' "-" "") offset))))] - (when (frac#decoded (all text#composite (if signed? "-" "") digits "." decimals exp)) + (when (dec#decoded (all text#composite (if signed? "-" "") digits "." decimals exp)) {try.#Success value} (in value) @@ -507,7 +507,7 @@ [any Any #Null] [bit Bit #Boolean] - [frac Frac #Number] + [dec Dec #Number] [text Text #String] ) @@ -520,15 +520,15 @@ (the (encoded input) (let [high (|> input (i64.and high_mask) (i64.right_shifted 32)) low (i64.and low_mask input)] - {#Array (sequence (|> high .int int.frac {#Number}) - (|> low .int int.frac {#Number}))})) + {#Array (sequence (|> high .int int.dec {#Number}) + (|> low .int int.dec {#Number}))})) (the (decoded it) (when it {#Array it'} (when (sequence.list it') (.list {#Number high} {#Number low}) - {try.#Success (nat.+ (|> high frac.int .nat (i64.left_shifted 32)) - (|> low frac.int .nat))} + {try.#Success (nat.+ (|> high dec.int .nat (i64.left_shifted 32)) + (|> low dec.int .nat))} _ (exception.except ..cannot_project [it])) diff --git a/stdlib/source/library/lux/debug.lux b/stdlib/source/library/lux/debug.lux index 348a1a860d..496df4562f 100644 --- a/stdlib/source/library/lux/debug.lux +++ b/stdlib/source/library/lux/debug.lux @@ -154,7 +154,7 @@ [java/lang/Boolean [ffi.of_boolean %.bit]] [java/lang/Long [ffi.of_long %.int]] - [java/lang/Number [(java/lang/Number::doubleValue []) ffi.of_double %.frac]] + [java/lang/Number [(java/lang/Number::doubleValue []) ffi.of_double %.dec]] [java/lang/String [ffi.of_string %.text]] )) (when (ffi.as [java/lang/Object] object) @@ -187,7 +187,7 @@ [ (`` (|> value (,, (template.spliced ))))]) (["boolean" [(as .Bit) %.bit]] - ["number" [(as .Frac) %.frac]] + ["number" [(as .Dec) %.dec]] ["string" [(as .Text) %.text]] ["undefined" [JSON::stringify]]) @@ -223,7 +223,7 @@ (`` (|> value (,, (template.spliced ))))]) (["" "" [(as .Bit) %.bit]] ["" "" [(as .Int) %.int]] - ["" "" [(as .Frac) %.frac]] + ["" "" [(as .Dec) %.dec]] ["" "" [(as .Text) %.text]] ["" "" [(as .Text) %.text]]) @@ -260,7 +260,7 @@ "number" (when (math::type value) {.#Some "integer"} (|> value (as .Int) %.int) - {.#Some "float"} (|> value (as .Frac) %.frac) + {.#Some "float"} (|> value (as .Dec) %.dec) _ (..tostring value)) @@ -298,7 +298,7 @@ [#0 Bit %.bit] [#1 Bit %.bit] [+1 Int %.int] - [+1.0 Frac %.frac] + [+1.0 Dec %.dec] ["" Text %.text] [(.ruby_object_nil#) Any (pipe.new "nil" [])] )) @@ -328,7 +328,7 @@ (`` (|> value (,, (template.spliced ))))]) (["boolean" [(as .Bit) %.bit]] ["integer" [(as .Int) %.int]] - ["double" [(as .Frac) %.frac]] + ["double" [(as .Dec) %.dec]] ["string" [(as .Text) %.text]] ["NULL" [(pipe.new "null" [])]] ["array" [(tuple_inspection inspection)]]) @@ -355,7 +355,7 @@ [..boolean? [(as .Bit) %.bit]] [..integer? [(as .Int) %.int]] - [..real? [(as .Frac) %.frac]] + [..real? [(as .Dec) %.dec]] [..string? [(as .Text) %.text]] ["scheme object nil?" [(pipe.new "()" [])]] [..vector? [(tuple_inspection inspection)]])) @@ -403,7 +403,7 @@ [Nat %.nat] [Int %.int] [Rev %.rev] - [Frac %.frac] + [Dec %.dec] [Text %.text])) ))) diff --git a/stdlib/source/library/lux/documentation.lux b/stdlib/source/library/lux/documentation.lux index b7451891c8..1b36953a58 100644 --- a/stdlib/source/library/lux/documentation.lux +++ b/stdlib/source/library/lux/documentation.lux @@ -74,7 +74,7 @@ [.#Nat] [.#Int] [.#Rev] - [.#Frac] + [.#Dec] [.#Text] [.#Symbol]) @@ -129,7 +129,7 @@ [.#Nat [%.nat]] [.#Int [%.int]] [.#Rev [%.rev]] - [.#Frac [%.frac]] + [.#Dec [%.dec]] [.#Text [%.text]]) (^.with_template [|<| |>| ] diff --git a/stdlib/source/library/lux/ffi.jvm.lux b/stdlib/source/library/lux/ffi.jvm.lux index 53d86a5da4..69086acb0c 100644 --- a/stdlib/source/library/lux/ffi.jvm.lux +++ b/stdlib/source/library/lux/ffi.jvm.lux @@ -361,7 +361,7 @@ (or (of jvm.equivalence = jvm.float type) (of jvm.equivalence = jvm.double type)) - (` .Frac) + (` .Dec) (of jvm.equivalence = jvm.char type) (` .Nat) @@ -2153,7 +2153,7 @@ [as_boolean .Bit ..Boolean of_boolean] [as_long .Int ..Long of_long] - [as_double .Frac ..Double of_double] + [as_double .Dec ..Double of_double] [as_string .Text ..String of_string] ) @@ -2170,5 +2170,5 @@ [as_short .Int ..long_to_short ..Long ..short_to_long ..Short of_short] [as_int .Int ..long_to_int ..Long ..int_to_long ..Integer of_int] [as_char .Int ..long_to_char ..Long ..char_to_long ..Character of_char] - [as_float .Frac ..double_to_float ..Double ..float_to_double ..Float of_float] + [as_float .Dec ..double_to_float ..Double ..float_to_double ..Float of_float] ) diff --git a/stdlib/source/library/lux/ffi.lux b/stdlib/source/library/lux/ffi.lux index e30ab7f48a..e2b4a51733 100644 --- a/stdlib/source/library/lux/ffi.lux +++ b/stdlib/source/library/lux/ffi.lux @@ -110,7 +110,7 @@ Access [Bit (Synthesis_Path s) (Maybe (Synthesis_Path s))] (Synthesis_Fork I64 (Synthesis_Path s)) - (Synthesis_Fork Frac (Synthesis_Path s)) + (Synthesis_Fork Dec (Synthesis_Path s)) (Synthesis_Fork Text (Synthesis_Path s)) [(Synthesis_Path s) (Synthesis_Path s)] [(Synthesis_Path s) (Synthesis_Path s)] @@ -402,13 +402,13 @@ )) - (with_expansions [ (for .js (these [Number Frac]) + (with_expansions [ (for .js (these [Number Dec]) .python (these [Integer Int] - [Float Frac]) + [Float Dec]) .lua (these [Integer Int] - [Float Frac]) + [Float Dec]) .ruby (these [Integer Int] - [Float Frac])) + [Float Dec])) ] (with_template [ ] [(every .public diff --git a/stdlib/source/library/lux/ffi.old.lux b/stdlib/source/library/lux/ffi.old.lux index c73346a4e2..ed4ca6e27a 100644 --- a/stdlib/source/library/lux/ffi.old.lux +++ b/stdlib/source/library/lux/ffi.old.lux @@ -78,7 +78,7 @@ [as_boolean .Bit "java.lang.Boolean" of_boolean] [as_long .Int "java.lang.Long" of_long] - [as_double .Frac "java.lang.Double" of_double] + [as_double .Dec "java.lang.Double" of_double] [as_string .Text "java.lang.String" of_string] ) @@ -94,7 +94,7 @@ [as_byte .Int ..long_to_byte "java.lang.Long" ..byte_to_long "java.lang.Byte" of_byte] [as_short .Int ..long_to_short "java.lang.Long" ..short_to_long "java.lang.Short" of_short] [as_int .Int ..long_to_int "java.lang.Long" ..int_to_long "java.lang.Integer" of_int] - [as_float .Frac ..double_to_float "java.lang.Double" ..float_to_double "java.lang.Float" of_float] + [as_float .Dec ..double_to_float "java.lang.Double" ..float_to_double "java.lang.Float" of_float] ) ... [Utils] @@ -316,8 +316,8 @@ ["short" .Int] ["int" .Int] ["long" .Int] - ["float" .Frac] - ["double" .Frac] + ["float" .Dec] + ["double" .Dec] ["void" .Any]) _ diff --git a/stdlib/source/library/lux/ffi.php.lux b/stdlib/source/library/lux/ffi.php.lux index 49233b41d8..eefb3a8e9e 100644 --- a/stdlib/source/library/lux/ffi.php.lux +++ b/stdlib/source/library/lux/ffi.php.lux @@ -41,7 +41,7 @@ [Boolean Bit] [Integer Int] - [Float Frac] + [Float Dec] [String Text] ) diff --git a/stdlib/source/library/lux/ffi.scm.lux b/stdlib/source/library/lux/ffi.scm.lux index 8ad32f1e1a..3a427437c5 100644 --- a/stdlib/source/library/lux/ffi.scm.lux +++ b/stdlib/source/library/lux/ffi.scm.lux @@ -43,7 +43,7 @@ [Boolean Bit] [Integer Int] - [Float Frac] + [Float Dec] [String Text] ) diff --git a/stdlib/source/library/lux/math.lux b/stdlib/source/library/lux/math.lux index dac2956313..821377d3da 100644 --- a/stdlib/source/library/lux/math.lux +++ b/stdlib/source/library/lux/math.lux @@ -37,7 +37,7 @@ ["[0]" nat] ["[0]" int] ["[0]" rev] - ["[0]" frac] + ["[0]" dec] ["[0]" ratio (.only Ratio)] ["[0]" complex (.only Complex)]]]) @@ -115,25 +115,25 @@ [+ [[.Nat (in (analysis.nat location.dummy 0)) .i64_+#|translation] [.Int (in (analysis.int location.dummy +0)) .i64_+#|translation] [.Rev (in (analysis.rev location.dummy .0)) .i64_+#|translation] - [.Frac (in (analysis.frac location.dummy +0.0)) .f64_+#|translation] + [.Dec (in (analysis.dec location.dummy +0.0)) .f64_+#|translation] [Ratio (type.expecting Ratio (phase archive (` ))) ratio.+] [Complex (type.expecting Complex (phase archive (` ))) complex.+]]] [- [[.Nat (in (analysis.nat location.dummy 0)) .i64_-#|translation] [.Int (in (analysis.int location.dummy -0)) .i64_-#|translation] [.Rev (in (analysis.rev location.dummy .0)) .i64_-#|translation] - [.Frac (in (analysis.frac location.dummy -0.0)) .f64_-#|translation] + [.Dec (in (analysis.dec location.dummy -0.0)) .f64_-#|translation] [Ratio (type.expecting Ratio (phase archive (` ))) ratio.-] [Complex (type.expecting Complex (phase archive (` ))) complex.-]]] [* [[.Nat (in (analysis.nat location.dummy 1)) nat.*] [.Int (in (analysis.int location.dummy +1)) .int_*#|translation] [.Rev (in (analysis.rev location.dummy rev./1)) rev.*] - [.Frac (in (analysis.frac location.dummy +1.0)) .f64_*#|translation] + [.Dec (in (analysis.dec location.dummy +1.0)) .f64_*#|translation] [Ratio (type.expecting Ratio (phase archive (` ))) ratio.*] [Complex (type.expecting Complex (phase archive (` ))) complex.*]]] [/ [[.Nat (in (analysis.nat location.dummy 1)) nat./] [.Int (in (analysis.int location.dummy +1)) .int_/#|translation] [.Rev (in (analysis.rev location.dummy rev./1)) rev./] - [.Frac (in (analysis.frac location.dummy +1.0)) .f64_/#|translation] + [.Dec (in (analysis.dec location.dummy +1.0)) .f64_/#|translation] [Ratio (type.expecting Ratio (phase archive (` ))) ratio./] [Complex (type.expecting Complex (phase archive (` ))) complex./]]] ) @@ -165,28 +165,28 @@ [= [[.Nat .i64_=#|translation] [.Int .i64_=#|translation] [.Rev .i64_=#|translation] - [.Frac .f64_=#|translation] + [.Dec .f64_=#|translation] [Ratio ratio.=] [Complex complex.=]]] [< [[.Nat nat.<] [.Int .int_<#|translation] [.Rev rev.<] - [.Frac .f64_<#|translation] + [.Dec .f64_<#|translation] [Ratio ratio.<]]] [> [[.Nat nat.>] [.Int int.>] [.Rev rev.>] - [.Frac frac.>] + [.Dec dec.>] [Ratio ratio.>]]] [<= [[.Nat nat.<=] [.Int int.<=] [.Rev rev.<=] - [.Frac frac.<=] + [.Dec dec.<=] [Ratio ratio.<=]]] [>= [[.Nat nat.>=] [.Int int.>=] [.Rev rev.>=] - [.Frac frac.>=] + [.Dec dec.>=] [Ratio ratio.>=]]] ) (with_template [ '] @@ -217,7 +217,7 @@ [% [[.Nat nat.%] [.Int .int_%#|translation] [.Rev rev.%] - [.Frac .f64_%#|translation] + [.Dec .f64_%#|translation] [Ratio ratio.%] [Complex complex.%]]] ) diff --git a/stdlib/source/library/lux/math/arithmetic/infix.lux b/stdlib/source/library/lux/math/arithmetic/infix.lux index e4791e0673..d10916beb8 100644 --- a/stdlib/source/library/lux/math/arithmetic/infix.lux +++ b/stdlib/source/library/lux/math/arithmetic/infix.lux @@ -37,7 +37,7 @@ (<>#each code.nat .nat) (<>#each code.int .int) (<>#each code.rev .rev) - (<>#each code.frac .frac) + (<>#each code.dec .dec) (<>#each code.text .text) (<>#each code.symbol .symbol))) diff --git a/stdlib/source/library/lux/math/geometry/circle.lux b/stdlib/source/library/lux/math/geometry/circle.lux index b4d265da11..6c34a6a515 100644 --- a/stdlib/source/library/lux/math/geometry/circle.lux +++ b/stdlib/source/library/lux/math/geometry/circle.lux @@ -6,10 +6,10 @@ [lux (.except) [math [number - ["f" frac]]]]]) + ["d" dec]]]]]) (every .public Angle - Frac) + Dec) (with_template [ ] [(the .public @@ -35,12 +35,12 @@ ... https://en.wikipedia.org/wiki/Degree_(angle) (the .public degree Angle - (f.of_degree ..tau)) + (d.of_degree ..tau)) ... https://en.wikipedia.org/wiki/Gradian (the .public gradian Angle - (f./ +400.0 ..tau)) + (d./ +400.0 ..tau)) ... https://en.wikipedia.org/wiki/Trigonometric_functions ... https://en.wikipedia.org/wiki/Inverse_trigonometric_functions @@ -51,13 +51,13 @@ ) ( it))] - [Angle Frac cos "jvm invokestatic:java.lang.Math:cos:double"] - [Angle Frac sin "jvm invokestatic:java.lang.Math:sin:double"] - [Angle Frac tan "jvm invokestatic:java.lang.Math:tan:double"] + [Angle Dec cos "jvm invokestatic:java.lang.Math:cos:double"] + [Angle Dec sin "jvm invokestatic:java.lang.Math:sin:double"] + [Angle Dec tan "jvm invokestatic:java.lang.Math:tan:double"] - [Frac Angle acos "jvm invokestatic:java.lang.Math:acos:double"] - [Frac Angle asin "jvm invokestatic:java.lang.Math:asin:double"] - [Frac Angle atan "jvm invokestatic:java.lang.Math:atan:double"] + [Dec Angle acos "jvm invokestatic:java.lang.Math:acos:double"] + [Dec Angle asin "jvm invokestatic:java.lang.Math:asin:double"] + [Dec Angle atan "jvm invokestatic:java.lang.Math:atan:double"] )) .jvm @@ -67,12 +67,12 @@ (as (Nominal "java.lang.Double")) .jvm_object_cast#)])) - (the !frac + (the !dec (template (_ value) [(|> value .jvm_object_cast# (is (Nominal "java.lang.Double")) - (as Frac))])) + (as Dec))])) (with_template [ ] [(the .public @@ -81,15 +81,15 @@ (|>> !double ["D"] (.jvm_member_invoke_static# [] "java.lang.Math" []) - !frac))] + !dec))] - [Angle Frac cos "cos"] - [Angle Frac sin "sin"] - [Angle Frac tan "tan"] + [Angle Dec cos "cos"] + [Angle Dec sin "sin"] + [Angle Dec tan "tan"] - [Frac Angle acos "acos"] - [Frac Angle asin "asin"] - [Frac Angle atan "atan"] + [Dec Angle acos "acos"] + [Dec Angle asin "asin"] + [Dec Angle atan "atan"] )) .js @@ -99,15 +99,15 @@ ) (|>> [] (.js_apply# (.js_constant# )) - (as Frac)))] + (as Dec)))] - [Angle Frac cos "Math.cos"] - [Angle Frac sin "Math.sin"] - [Angle Frac tan "Math.tan"] + [Angle Dec cos "Math.cos"] + [Angle Dec sin "Math.sin"] + [Angle Dec tan "Math.tan"] - [Frac Angle acos "Math.acos"] - [Frac Angle asin "Math.asin"] - [Frac Angle atan "Math.atan"] + [Dec Angle acos "Math.acos"] + [Dec Angle asin "Math.asin"] + [Dec Angle atan "Math.atan"] )) .python @@ -117,15 +117,15 @@ ) (|>> [] (.python_object_do# (.python_import# "math")) - (as Frac)))] + (as Dec)))] - [Angle Frac cos "cos"] - [Angle Frac sin "sin"] - [Angle Frac tan "tan"] + [Angle Dec cos "cos"] + [Angle Dec sin "sin"] + [Angle Dec tan "tan"] - [Frac Angle acos "acos"] - [Frac Angle asin "asin"] - [Frac Angle atan "atan"] + [Dec Angle acos "acos"] + [Dec Angle asin "asin"] + [Dec Angle atan "atan"] )) .lua @@ -135,15 +135,15 @@ ) (|>> [] (.lua_apply# (.lua_constant# )) - (as Frac)))] + (as Dec)))] - [Angle Frac cos "math.cos"] - [Angle Frac sin "math.sin"] - [Angle Frac tan "math.tan"] + [Angle Dec cos "math.cos"] + [Angle Dec sin "math.sin"] + [Angle Dec tan "math.tan"] - [Frac Angle acos "math.acos"] - [Frac Angle asin "math.asin"] - [Frac Angle atan "math.atan"] + [Dec Angle acos "math.acos"] + [Dec Angle asin "math.asin"] + [Dec Angle atan "math.atan"] )) .ruby @@ -153,15 +153,15 @@ ) (|>> [] (.ruby_apply# (.ruby_constant# )) - (as Frac)))] + (as Dec)))] - [Angle Frac cos "Math.cos"] - [Angle Frac sin "Math.sin"] - [Angle Frac tan "Math.tan"] + [Angle Dec cos "Math.cos"] + [Angle Dec sin "Math.sin"] + [Angle Dec tan "Math.tan"] - [Frac Angle acos "Math.acos"] - [Frac Angle asin "Math.asin"] - [Frac Angle atan "Math.atan"] + [Dec Angle acos "Math.acos"] + [Dec Angle asin "Math.asin"] + [Dec Angle atan "Math.atan"] )) .php @@ -170,15 +170,15 @@ (-> ) (|>> ("php apply" ("php constant" )) - (as Frac)))] + (as Dec)))] - [Angle Frac cos "cos"] - [Angle Frac sin "sin"] - [Angle Frac tan "tan"] + [Angle Dec cos "cos"] + [Angle Dec sin "sin"] + [Angle Dec tan "tan"] - [Frac Angle acos "acos"] - [Frac Angle asin "asin"] - [Frac Angle atan "atan"] + [Dec Angle acos "acos"] + [Dec Angle asin "asin"] + [Dec Angle atan "atan"] )) .scheme @@ -187,45 +187,45 @@ (-> ) (|>> ("scheme apply" ("scheme constant" )) - (as Frac)))] + (as Dec)))] - [Angle Frac cos "cos"] - [Angle Frac sin "sin"] - [Angle Frac tan "tan"] + [Angle Dec cos "cos"] + [Angle Dec sin "sin"] + [Angle Dec tan "tan"] - [Frac Angle acos "acos"] - [Frac Angle asin "asin"] - [Frac Angle atan "atan"] + [Dec Angle acos "acos"] + [Dec Angle asin "asin"] + [Dec Angle atan "atan"] )) ) (the .public (atan_2 x y) - (-> Frac Frac - Frac) - (cond (f.< x +0.0) - (..atan (f./ x y)) - - (f.< +0.0 x) - (if (or (f.< y +0.0) - (f.= +0.0 y)) - (|> y (f./ x) atan (f.+ pi)) - (|> y (f./ x) atan (f.- pi))) - - ... (f.= +0.0 x) - (cond (f.< y +0.0) - (|> pi (f./ +2.0)) + (-> Dec Dec + Dec) + (cond (d.< x +0.0) + (..atan (d./ x y)) + + (d.< +0.0 x) + (if (or (d.< y +0.0) + (d.= +0.0 y)) + (|> y (d./ x) atan (d.+ pi)) + (|> y (d./ x) atan (d.- pi))) + + ... (d.= +0.0 x) + (cond (d.< y +0.0) + (|> pi (d./ +2.0)) - (f.< +0.0 y) - (|> pi (f./ -2.0)) + (d.< +0.0 y) + (|> pi (d./ -2.0)) - ... (f.= +0.0 y) - (f./ +0.0 +0.0)))) + ... (d.= +0.0 y) + (d./ +0.0 +0.0)))) (the .public (hypotenuse catA catB) - (-> Frac Frac - Frac) - (f.pow +0.5 (f.+ (f.* catA catA) - (f.* catB catB)))) + (-> Dec Dec + Dec) + (d.pow +0.5 (d.+ (d.* catA catA) + (d.* catB catB)))) (alias [sine] ..sin) @@ -239,9 +239,9 @@ (with_template [ ] [(the .public (-> Angle - Frac) + Dec) (|>> - f.reciprocal))] + d.reciprocal))] [secant co_sine] [co_secant sine] @@ -260,8 +260,8 @@ (with_template [ ] [(the .public (-> Angle - Frac) - (|>> f.reciprocal + Dec) + (|>> d.reciprocal ))] [arc_secant ..acos] diff --git a/stdlib/source/library/lux/math/geometry/hyperbola.lux b/stdlib/source/library/lux/math/geometry/hyperbola.lux index b32611604b..01226d77da 100644 --- a/stdlib/source/library/lux/math/geometry/hyperbola.lux +++ b/stdlib/source/library/lux/math/geometry/hyperbola.lux @@ -7,20 +7,20 @@ [lux (.except) [math [number - ["/" frac]]]]]) + ["/" dec]]]]]) ... https://en.wikipedia.org/wiki/Hyperbolic_function#Definitions (with_template [ ] [(the .public ( it) - (-> Frac - Frac) + (-> Dec + Dec) (|> (/.exp it) ( (/.exp (.f64_*# -1.0 it))) (.f64_/# +2.0))) (the .public ( it) - (-> Frac - Frac) + (-> Dec + Dec) (|> +2.0 (.f64_/# (|> (/.exp it) ( (/.exp (.f64_*# -1.0 it)))))))] @@ -31,8 +31,8 @@ (with_template [ ] [(the .public ( it) - (-> Frac - Frac) + (-> Dec + Dec) (let [e+ (/.exp it) e- (/.exp (.f64_*# -1.0 it)) sine' (|> e+ (.f64_-# e-)) @@ -46,8 +46,8 @@ ... https://en.wikipedia.org/wiki/Inverse_hyperbolic_functions#Definitions_in_terms_of_logarithms (with_template [ ] [(the .public ( it) - (-> Frac - Frac) + (-> Dec + Dec) (|> it (/.pow +2.0) ( +1.0) @@ -61,8 +61,8 @@ (with_template [ ] [(the .public ( it) - (-> Frac - Frac) + (-> Dec + Dec) (let [it+ (|> (.f64_+# )) it- (|> (.f64_-# ))] (|> it+ @@ -76,8 +76,8 @@ (with_template [ ] [(the .public ( it) - (-> Frac - Frac) + (-> Dec + Dec) (let [it^2 (|> it (/.pow +2.0))] (|> +1.0 ( it^2) diff --git a/stdlib/source/library/lux/math/number.lux b/stdlib/source/library/lux/math/number.lux index 52a97c1de3..c57d0776a9 100644 --- a/stdlib/source/library/lux/math/number.lux +++ b/stdlib/source/library/lux/math/number.lux @@ -17,7 +17,7 @@ ["[1][0]" nat] ["[1][0]" int] ["[1][0]" rev] - ["[1][0]" frac]]) + ["[1][0]" dec]]) (the separator ",") @@ -61,13 +61,13 @@ [(^.multi {try.#Failure _} [(of decoded repr) {try.#Success value}]) - {try.#Success [state (list [meta {.#Frac value}])]}] + {try.#Success [state (list [meta {.#Dec value}])]}] - [/frac.degree] - [/frac.percentage] - [/frac.permille] - [/frac.permyriad] - [/frac.decimal] + [/dec.degree] + [/dec.percentage] + [/dec.permille] + [/dec.permyriad] + [/dec.decimal] )) _ @@ -79,7 +79,7 @@ (alias [decimal] ..dec) -(with_template [ ] +(with_template [ ] [(the .public (macro (_ tokens state) (when tokens @@ -102,9 +102,9 @@ {try.#Success [state (list [meta {.#Rev value}])]} (^.multi {try.#Failure _} - [(of decoded repr) + [(of decoded repr) {try.#Success value}]) - {try.#Success [state (list [meta {.#Frac value}])]} + {try.#Success [state (list [meta {.#Dec value}])]} _ {try.#Failure }))) @@ -112,9 +112,9 @@ _ {try.#Failure })))] - [bin /nat.binary /int.binary /rev.binary /frac.binary "Invalid binary syntax."] - [oct /nat.octal /int.octal /rev.octal /frac.octal "Invalid octal syntax."] - [hex /nat.hex /int.hex /rev.hex /frac.hex "Invalid hexadecimal syntax."] + [bin /nat.binary /int.binary /rev.binary /dec.binary "Invalid binary syntax."] + [oct /nat.octal /int.octal /rev.octal /dec.octal "Invalid octal syntax."] + [hex /nat.hex /int.hex /rev.hex /dec.hex "Invalid hexadecimal syntax."] ) (alias [binary] diff --git a/stdlib/source/library/lux/math/number/complex.lux b/stdlib/source/library/lux/math/number/complex.lux index 1cb21c84c2..3337d937bc 100644 --- a/stdlib/source/library/lux/math/number/complex.lux +++ b/stdlib/source/library/lux/math/number/complex.lux @@ -18,7 +18,7 @@ ["[0]" list (.use "[1]#[0]" functor)]]] [math [number - ["f" frac] + ["d" dec] ["[0]" int]] [geometry ["[0]" circle] @@ -33,8 +33,8 @@ (every .public Complex (Record - [#real Frac - #imaginary Frac])) + [#real Dec + #imaginary Dec])) (the .public complex (syntax (_ [real .any @@ -61,15 +61,15 @@ (the .public (not_a_number? complex) (-> Complex Bit) - (or (f.not_a_number? (its #real complex)) - (f.not_a_number? (its #imaginary complex)))) + (or (d.not_a_number? (its #real complex)) + (d.not_a_number? (its #imaginary complex)))) (the .public (= param input) (-> Complex Complex Bit) - (and (f.= (its #real param) + (and (d.= (its #real param) (its #real input)) - (f.= (its #imaginary param) + (d.= (its #imaginary param) (its #imaginary input)))) (with_template [ ] @@ -81,8 +81,8 @@ #imaginary ( (its #imaginary param) (its #imaginary input))])] - [+ f.+] - [- f.-] + [+ d.+] + [- d.-] ) (the .public equivalence @@ -97,64 +97,64 @@ (|>> (revised #real ) (revised #imaginary )))] - [opposite f.opposite] - [signum f.signum] + [opposite d.opposite] + [signum d.signum] ) (the .public conjugate (-> Complex Complex) - (revised #imaginary f.opposite)) + (revised #imaginary d.opposite)) (the .public (*' param input) - (-> Frac Complex + (-> Dec Complex Complex) - [#real (f.* param + [#real (d.* param (its #real input)) - #imaginary (f.* param + #imaginary (d.* param (its #imaginary input))]) (the .public (* param input) (-> Complex Complex Complex) - [#real (f.- (f.* (its #imaginary param) + [#real (d.- (d.* (its #imaginary param) (its #imaginary input)) - (f.* (its #real param) + (d.* (its #real param) (its #real input))) - #imaginary (f.+ (f.* (its #real param) + #imaginary (d.+ (d.* (its #real param) (its #imaginary input)) - (f.* (its #imaginary param) + (d.* (its #imaginary param) (its #real input)))]) (the .public (/ param input) (-> Complex Complex Complex) (let [(open "/[0]") param] - (if (f.< (f.abs /#imaginary) - (f.abs /#real)) - (let [quot (f./ /#imaginary /#real) - denom (|> /#real (f.* quot) (f.+ /#imaginary))] - [..#real (|> (its ..#real input) (f.* quot) (f.+ (its ..#imaginary input)) (f./ denom)) - ..#imaginary (|> (its ..#imaginary input) (f.* quot) (f.- (its ..#real input)) (f./ denom))]) - (let [quot (f./ /#real /#imaginary) - denom (|> /#imaginary (f.* quot) (f.+ /#real))] - [..#real (|> (its ..#imaginary input) (f.* quot) (f.+ (its ..#real input)) (f./ denom)) - ..#imaginary (|> (its ..#imaginary input) (f.- (f.* quot (its ..#real input))) (f./ denom))])))) + (if (d.< (d.abs /#imaginary) + (d.abs /#real)) + (let [quot (d./ /#imaginary /#real) + denom (|> /#real (d.* quot) (d.+ /#imaginary))] + [..#real (|> (its ..#real input) (d.* quot) (d.+ (its ..#imaginary input)) (d./ denom)) + ..#imaginary (|> (its ..#imaginary input) (d.* quot) (d.- (its ..#real input)) (d./ denom))]) + (let [quot (d./ /#real /#imaginary) + denom (|> /#imaginary (d.* quot) (d.+ /#real))] + [..#real (|> (its ..#imaginary input) (d.* quot) (d.+ (its ..#real input)) (d./ denom)) + ..#imaginary (|> (its ..#imaginary input) (d.- (d.* quot (its ..#real input))) (d./ denom))])))) (the .public (/' param subject) - (-> Frac Complex + (-> Dec Complex Complex) (let [(open "/[0]") subject] - [..#real (f./ param /#real) - ..#imaginary (f./ param /#imaginary)])) + [..#real (d./ param /#real) + ..#imaginary (d./ param /#imaginary)])) (the .public (% param input) (-> Complex Complex Complex) (let [scaled (/ param input) quotient (|> scaled - (revised #real f.floor) - (revised #imaginary f.floor))] + (revised #real d.floor) + (revised #imaginary d.floor))] (- (* quotient param) input))) @@ -170,88 +170,88 @@ (-> Complex Complex) (let [(open "/[0]") subject] - [..#real (f.* (hyperbola.co_sine /#imaginary) + [..#real (d.* (hyperbola.co_sine /#imaginary) (circle.cos /#real)) - ..#imaginary (f.opposite (f.* (hyperbola.sine /#imaginary) + ..#imaginary (d.opposite (d.* (hyperbola.sine /#imaginary) (circle.sin /#real)))])) (the .public (cosh subject) (-> Complex Complex) (let [(open "/[0]") subject] - [..#real (f.* (circle.cos /#imaginary) + [..#real (d.* (circle.cos /#imaginary) (hyperbola.co_sine /#real)) - ..#imaginary (f.* (circle.sin /#imaginary) + ..#imaginary (d.* (circle.sin /#imaginary) (hyperbola.sine /#real))])) (the .public (sin subject) (-> Complex Complex) (let [(open "/[0]") subject] - [..#real (f.* (hyperbola.co_sine /#imaginary) + [..#real (d.* (hyperbola.co_sine /#imaginary) (circle.sin /#real)) - ..#imaginary (f.* (hyperbola.sine /#imaginary) + ..#imaginary (d.* (hyperbola.sine /#imaginary) (circle.cos /#real))])) (the .public (sinh subject) (-> Complex Complex) (let [(open "/[0]") subject] - [..#real (f.* (circle.cos /#imaginary) + [..#real (d.* (circle.cos /#imaginary) (hyperbola.sine /#real)) - ..#imaginary (f.* (circle.sin /#imaginary) + ..#imaginary (d.* (circle.sin /#imaginary) (hyperbola.co_sine /#real))])) (the .public (tan subject) (-> Complex Complex) (let [(open "/[0]") subject - r2 (f.* +2.0 /#real) - i2 (f.* +2.0 /#imaginary) - d (f.+ (circle.cos r2) (hyperbola.co_sine i2))] - [..#real (f./ d (circle.sin r2)) - ..#imaginary (f./ d (hyperbola.sine i2))])) + r2 (d.* +2.0 /#real) + i2 (d.* +2.0 /#imaginary) + d (d.+ (circle.cos r2) (hyperbola.co_sine i2))] + [..#real (d./ d (circle.sin r2)) + ..#imaginary (d./ d (hyperbola.sine i2))])) (the .public (tanh subject) (-> Complex Complex) (let [(open "/[0]") subject - r2 (f.* +2.0 /#real) - i2 (f.* +2.0 /#imaginary) - d (f.+ (hyperbola.co_sine r2) (circle.cos i2))] - [..#real (f./ d (hyperbola.sine r2)) - ..#imaginary (f./ d (circle.sin i2))])) + r2 (d.* +2.0 /#real) + i2 (d.* +2.0 /#imaginary) + d (d.+ (hyperbola.co_sine r2) (circle.cos i2))] + [..#real (d./ d (hyperbola.sine r2)) + ..#imaginary (d./ d (circle.sin i2))])) (the .public (abs subject) (-> Complex - Frac) + Dec) (let [(open "/[0]") subject] - (if (f.< (f.abs /#imaginary) - (f.abs /#real)) - (if (f.= +0.0 /#imaginary) - (f.abs /#real) - (let [q (f./ /#imaginary /#real)] - (f.* (f.pow +0.5 (f.+ +1.0 (f.* q q))) - (f.abs /#imaginary)))) - (if (f.= +0.0 /#real) - (f.abs /#imaginary) - (let [q (f./ /#real /#imaginary)] - (f.* (f.pow +0.5 (f.+ +1.0 (f.* q q))) - (f.abs /#real))))))) + (if (d.< (d.abs /#imaginary) + (d.abs /#real)) + (if (d.= +0.0 /#imaginary) + (d.abs /#real) + (let [q (d./ /#imaginary /#real)] + (d.* (d.pow +0.5 (d.+ +1.0 (d.* q q))) + (d.abs /#imaginary)))) + (if (d.= +0.0 /#real) + (d.abs /#imaginary) + (let [q (d./ /#real /#imaginary)] + (d.* (d.pow +0.5 (d.+ +1.0 (d.* q q))) + (d.abs /#real))))))) (the .public (exp subject) (-> Complex Complex) (let [(open "/[0]") subject - r_exp (f.exp /#real)] - [..#real (f.* r_exp (circle.cos /#imaginary)) - ..#imaginary (f.* r_exp (circle.sin /#imaginary))])) + r_exp (d.exp /#real)] + [..#real (d.* r_exp (circle.cos /#imaginary)) + ..#imaginary (d.* r_exp (circle.sin /#imaginary))])) (the .public (log subject) (-> Complex Complex) (let [(open "/[0]") subject] - [..#real (|> subject ..abs f.log) + [..#real (|> subject ..abs d.log) ..#imaginary (circle.atan_2 /#real /#imaginary)])) (with_template [ ] @@ -261,25 +261,25 @@ (|> input log ( param) exp))] [pow Complex ..*] - [pow' Frac ..*'] + [pow' Dec ..*'] ) (the (with_sign sign magnitude) - (-> Frac Frac - Frac) - (f.* (f.signum sign) magnitude)) + (-> Dec Dec + Dec) + (d.* (d.signum sign) magnitude)) (the .public (root_2 input) (-> Complex Complex) (let [(open "/[0]") input - t (|> input ..abs (f.+ (f.abs /#real)) (f./ +2.0) (f.pow +0.5))] - (if (f.< +0.0 /#real) - [..#real (f./ (f.* +2.0 t) - (f.abs /#imaginary)) - ..#imaginary (f.* t (..with_sign /#imaginary +1.0))] + t (|> input ..abs (d.+ (d.abs /#real)) (d./ +2.0) (d.pow +0.5))] + (if (d.< +0.0 /#real) + [..#real (d./ (d.* +2.0 t) + (d.abs /#imaginary)) + ..#imaginary (d.* t (..with_sign /#imaginary +1.0))] [..#real t - ..#imaginary (f./ (f.* +2.0 t) + ..#imaginary (d./ (d.* +2.0 t) /#imaginary)]))) (the (root_2-1z input) @@ -290,18 +290,18 @@ (the .public (reciprocal (open "/[0]")) (-> Complex Complex) - (if (f.< (f.abs /#imaginary) - (f.abs /#real)) - (let [q (f./ /#imaginary /#real) - scale (f./ (|> /#real (f.* q) (f.+ /#imaginary)) + (if (d.< (d.abs /#imaginary) + (d.abs /#real)) + (let [q (d./ /#imaginary /#real) + scale (d./ (|> /#real (d.* q) (d.+ /#imaginary)) +1.0)] - [..#real (f.* q scale) - ..#imaginary (f.opposite scale)]) - (let [q (f./ /#real /#imaginary) - scale (f./ (|> /#imaginary (f.* q) (f.+ /#real)) + [..#real (d.* q scale) + ..#imaginary (d.opposite scale)]) + (let [q (d./ /#real /#imaginary) + scale (d./ (|> /#imaginary (d.* q) (d.+ /#real)) +1.0)] [..#real scale - ..#imaginary (|> scale f.opposite (f.* q))]))) + ..#imaginary (|> scale d.opposite (d.* q))]))) (the .public (acos input) (-> Complex @@ -331,7 +331,7 @@ (the .public (argument (open "/[0]")) (-> Complex - Frac) + Dec) (circle.atan_2 /#real /#imaginary)) (the .public (roots nth input) @@ -339,37 +339,37 @@ (List Complex)) (when nth 0 (list) - _ (let [r_nth (|> nth .int int.frac) - nth_root_of_abs (|> input ..abs (f.pow (f./ r_nth +1.0))) - nth_phi (|> input ..argument (f./ r_nth)) - slice (f./ r_nth circle.tau)] + _ (let [r_nth (|> nth .int int.dec) + nth_root_of_abs (|> input ..abs (d.pow (d./ r_nth +1.0))) + nth_phi (|> input ..argument (d./ r_nth)) + slice (d./ r_nth circle.tau)] (|> (list.indices nth) (list#each (function (_ nth') - (let [inner (|> nth' .int int.frac - (f.* slice) - (f.+ nth_phi)) - real (f.* nth_root_of_abs + (let [inner (|> nth' .int int.dec + (d.* slice) + (d.+ nth_phi)) + real (d.* nth_root_of_abs (circle.cos inner)) - imaginary (f.* nth_root_of_abs + imaginary (d.* nth_root_of_abs (circle.sin inner))] [..#real real ..#imaginary imaginary]))))))) (the .public (approximately? margin_of_error standard value) - (-> Frac Complex Complex + (-> Dec Complex Complex Bit) - (and (f.approximately? margin_of_error + (and (d.approximately? margin_of_error (its ..#real standard) (its ..#real value)) - (f.approximately? margin_of_error + (d.approximately? margin_of_error (its ..#imaginary standard) (its ..#imaginary value)))) (the .public (format it) (-> Complex Text) - (.text_composite# (of f.decimal encoded (its ..#real it)) - " " (of f.decimal encoded (its ..#imaginary it)) "i")) + (.text_composite# (of d.decimal encoded (its ..#real it)) + " " (of d.decimal encoded (its ..#imaginary it)) "i")) (the .public codec (Codec Text Complex) @@ -379,37 +379,37 @@ (when (text.split_by " " it) {.#Some [real imaginary]} (do try.monad - [real (of f.decimal decoded real) - imaginary (of f.decimal decoded (text.replaced_once "i" "" imaginary))] + [real (of d.decimal decoded real) + imaginary (of d.decimal decoded (text.replaced_once "i" "" imaginary))] (in [#real real #imaginary imaginary])) {.#None} (do try.monad - [real (of f.decimal decoded it)] + [real (of d.decimal decoded it)] (in [#real real #imaginary +0.0])))))) ... https://en.wikipedia.org/wiki/Polar_coordinate_system (the (square it) - (-> Frac - Frac) - (f.* it it)) + (-> Dec + Dec) + (d.* it it)) (the .public (magnitude it) (-> Complex - Frac) - (f.root_2 (f.+ (square (its #real it)) + Dec) + (d.root_2 (d.+ (square (its #real it)) (square (its #imaginary it))))) (the .public (phase it) (-> Complex - Frac) + Dec) (circle.atan_2 (its #real it) (its #imaginary it))) (the .public (polar magnitude phase) - (-> Frac Frac + (-> Dec Dec Complex) - [#real (f.* magnitude (circle.cos phase)) - #imaginary (f.* magnitude (circle.sin phase))]) + [#real (d.* magnitude (circle.cos phase)) + #imaginary (d.* magnitude (circle.sin phase))]) diff --git a/stdlib/source/library/lux/math/number/frac.lux b/stdlib/source/library/lux/math/number/dec.lux similarity index 87% rename from stdlib/source/library/lux/math/number/frac.lux rename to stdlib/source/library/lux/math/number/dec.lux index 28664ba6e7..eacf60eb85 100644 --- a/stdlib/source/library/lux/math/number/frac.lux +++ b/stdlib/source/library/lux/math/number/dec.lux @@ -30,7 +30,7 @@ (with_template [ ] [(the .public - Frac + Dec )] [e +2.7182818284590452354] @@ -40,8 +40,8 @@ (for .old (these (with_template [ ] [(the .public ( it) - (-> Frac - Frac) + (-> Dec + Dec) ( it))] [exp "jvm invokestatic:java.lang.Math:exp:double"] @@ -55,8 +55,8 @@ ) (the .public (pow param subject) - (-> Frac Frac - Frac) + (-> Dec Dec + Dec) ("jvm invokestatic:java.lang.Math:pow:double,double" subject param))) .jvm @@ -66,21 +66,21 @@ (as (Nominal "java.lang.Double")) .jvm_object_cast#)])) - (the !frac + (the !dec (template (_ value) [(|> value .jvm_object_cast# (is (Nominal "java.lang.Double")) - (as Frac))])) + (as Dec))])) (with_template [ ] [(the .public - (-> Frac - Frac) + (-> Dec + Dec) (|>> !double ["D"] (.jvm_member_invoke_static# [] "java.lang.Math" []) - !frac))] + !dec))] [exp "exp"] [log "log"] @@ -93,20 +93,20 @@ ) (the .public (pow param subject) - (-> Frac Frac - Frac) + (-> Dec Dec + Dec) (|> (.jvm_member_invoke_static# [] "java.lang.Math" "pow" [] ["D" (!double subject)] ["D" (!double param)]) - !frac))) + !dec))) .js (these (with_template [ ] [(the .public - (-> Frac - Frac) + (-> Dec + Dec) (|>> [] (.js_apply# (.js_constant# )) - (as Frac)))] + (as Dec)))] [exp "Math.exp"] [log "Math.log"] @@ -119,18 +119,18 @@ ) (the .public (pow param subject) - (-> Frac Frac - Frac) - (as Frac (.js_apply# (.js_constant# "Math.pow") [subject param])))) + (-> Dec Dec + Dec) + (as Dec (.js_apply# (.js_constant# "Math.pow") [subject param])))) .python (these (with_template [ ] [(the .public - (-> Frac - Frac) + (-> Dec + Dec) (|>> [] (.python_object_do# (.python_import# "math")) - (as Frac)))] + (as Dec)))] [exp "exp"] [log "log"] @@ -142,13 +142,13 @@ ) (the .public (pow param subject) - (-> Frac Frac - Frac) - (as Frac (.python_object_do# "pow" (.python_import# "math") [subject param]))) + (-> Dec Dec + Dec) + (as Dec (.python_object_do# "pow" (.python_import# "math") [subject param]))) (the .public (root_3 it) - (-> Frac - Frac) + (-> Dec + Dec) (if (.f64_<# +0.0 it) (|> it (.f64_*# -1.0) @@ -160,11 +160,11 @@ .lua (these (with_template [ ] [(the .public - (-> Frac - Frac) + (-> Dec + Dec) (|>> [] (.lua_apply# (.lua_constant# )) - (as Frac)))] + (as Dec)))] [exp "math.exp"] [log "math.log"] @@ -176,13 +176,13 @@ ) (the .public (pow param subject) - (-> Frac Frac - Frac) + (-> Dec Dec + Dec) (.lua_power# param subject)) (the .public (root_3 it) - (-> Frac - Frac) + (-> Dec + Dec) (if (.f64_<# +0.0 it) (|> it (.f64_*# -1.0) @@ -194,11 +194,11 @@ .ruby (these (with_template [ ] [(the .public - (-> Frac - Frac) + (-> Dec + Dec) (|>> [] (.ruby_apply# (.ruby_constant# )) - (as Frac)))] + (as Dec)))] [exp "Math.exp"] [log "Math.log"] @@ -209,8 +209,8 @@ (with_template [ ] [(the .public ( it) - (-> Frac - Frac) + (-> Dec + Dec) (|> (.ruby_object_do# it []) (as Int) (.int_f64#)))] @@ -220,17 +220,17 @@ ) (the .public (pow param subject) - (-> Frac Frac - Frac) - (as Frac (.ruby_object_do# "**" subject [param])))) + (-> Dec Dec + Dec) + (as Dec (.ruby_object_do# "**" subject [param])))) .php (these (with_template [ ] [(the .public - (-> Frac - Frac) + (-> Dec + Dec) (|>> ("php apply" ("php constant" )) - (as Frac)))] + (as Dec)))] [exp "exp"] [log "log"] @@ -242,22 +242,22 @@ ) (the .public (pow param subject) - (-> Frac Frac - Frac) - (as Frac ("php apply" ("php constant" "pow") subject param))) + (-> Dec Dec + Dec) + (as Dec ("php apply" ("php constant" "pow") subject param))) (the .public root_3 - (-> Frac - Frac) + (-> Dec + Dec) (..pow (.f64_/# +3.0 +1.0)))) .scheme (these (with_template [ ] [(the .public - (-> Frac - Frac) + (-> Dec + Dec) (|>> ("scheme apply" ("scheme constant" )) - (as Frac)))] + (as Dec)))] [exp "exp"] [log "log"] @@ -269,19 +269,19 @@ ) (the .public (pow param subject) - (-> Frac Frac - Frac) - (as Frac ("scheme apply" ("scheme constant" "expt") subject param))) + (-> Dec Dec + Dec) + (as Dec ("scheme apply" ("scheme constant" "expt") subject param))) (the .public root_3 - (-> Frac - Frac) + (-> Dec + Dec) (..pow (.f64_/# +3.0 +1.0)))) ) (the .public (round it) - (-> Frac - Frac) + (-> Dec + Dec) (let [floored (floor it) diff (.f64_-# floored it)] (cond (.f64_<# diff +0.5) @@ -294,8 +294,8 @@ floored))) (the .public (log_by base it) - (-> Frac Frac - Frac) + (-> Dec Dec + Dec) (.f64_/# (..log base) (..log it))) @@ -310,7 +310,7 @@ (with_template [ ] [(the .public ( param subject) - (-> Frac Frac + (-> Dec Dec Bit) ( param subject))] @@ -319,25 +319,25 @@ ) (the .public (<= reference it) - (-> Frac Frac + (-> Dec Dec Bit) (or (.f64_<# reference it) (.f64_=# reference it))) (the .public (> reference it) - (-> Frac Frac + (-> Dec Dec Bit) (.f64_<# it reference)) (the .public (>= reference it) - (-> Frac Frac + (-> Dec Dec Bit) (or (.f64_<# it reference) (.f64_=# it reference))) (with_template [ ] [(the .public - (Predicate Frac) + (Predicate Dec) ( +0.0))] [..> positive?] @@ -347,8 +347,8 @@ (with_template [ ] [(the .public ( param subject) - (-> Frac Frac - Frac) + (-> Dec Dec + Dec) ( param subject))] [+ .f64_+#] @@ -359,7 +359,7 @@ ) (the .public arithmetic - (Arithmetic Frac) + (Arithmetic Dec) (implementation (the + ..+) (the - ..-) @@ -367,38 +367,38 @@ (the / ../))) (the .public (/% param subject) - (-> Frac Frac - [Frac Frac]) + (-> Dec Dec + [Dec Dec]) [(../ param subject) (..% param subject)]) (the .public opposite - (-> Frac - Frac) + (-> Dec + Dec) (..* -1.0)) (the .public (abs it) - (-> Frac - Frac) + (-> Dec + Dec) (if (..< +0.0 it) (..* -1.0 it) it)) (the .public (signum it) - (-> Frac - Frac) + (-> Dec + Dec) (cond (..= +0.0 it) +0.0 (..< +0.0 it) -1.0 ... else +1.0)) (the min_exponent -1022) -(the max_exponent (//int.frac +1023)) +(the max_exponent (//int.dec +1023)) (with_template [ ] [(the .public ( left right) - (-> Frac Frac - Frac) + (-> Dec Dec + Dec) (if ( right left) left right))] @@ -408,35 +408,35 @@ ) (the .public nat - (-> Frac + (-> Dec Nat) (|>> .f64_int# .nat)) (the .public int - (-> Frac + (-> Dec Int) (|>> .f64_int#)) (the mantissa_size Nat 52) (the exponent_size Nat 11) -(the frac_denominator +(the dec_denominator (|> -1 (.i64_right# ..exponent_size) .int_f64#)) (the .public rev - (-> Frac + (-> Dec Rev) (|>> ..abs (..% +1.0) - (..* ..frac_denominator) + (..* ..dec_denominator) .f64_int# (.i64_left# ..exponent_size))) (with_template [ ] [(the .public - Frac + Dec (../ +0.0 ))] [not_a_number +0.0] @@ -444,23 +444,23 @@ ) (the .public negative_infinity - Frac + Dec (..* -1.0 ..positive_infinity)) (the .public (not_a_number? it) - (-> Frac + (-> Dec Bit) (not (..= it it))) (the .public (number? it) - (-> Frac + (-> Dec Bit) (not (or (..not_a_number? it) (..= ..positive_infinity it) (..= ..negative_infinity it)))) (the .public equivalence - (Equivalence Frac) + (Equivalence Dec) (implementation (the (= left right) (or (..= left right) @@ -468,19 +468,19 @@ (..not_a_number? right)))))) (the .public order - (Order Frac) + (Order Dec) (implementation (the equivalence ..equivalence) (the < ..<))) (the .public smallest - Frac - (..pow (//int.frac (//int.- (.int ..mantissa_size) ..min_exponent)) + Dec + (..pow (//int.dec (//int.- (.int ..mantissa_size) ..min_exponent)) +2.0)) (the .public biggest - Frac - (let [f2^-52 (..pow (//nat.frac (//nat.- ..mantissa_size 0)) +2.0) + Dec + (let [f2^-52 (..pow (//nat.dec (//nat.- ..mantissa_size 0)) +2.0) f2^+1023 (..pow ..max_exponent +2.0)] (|> +2.0 (..- f2^-52) @@ -488,7 +488,7 @@ (with_template [ ] [(the .public - (Monoid Frac) + (Monoid Dec) (implementation (the identity ) (the composite )))] @@ -505,7 +505,7 @@ "Cannot decode.")) (the .public decimal - (Codec Text Frac) + (Codec Text Dec) (implementation (the (encoded x) (when x @@ -526,8 +526,8 @@ {try.#Failure ..cannot_decode})))) (the log/2 - (-> Frac - Frac) + (-> Dec + Dec) (|>> ..log (../ (..log +2.0)))) @@ -557,13 +557,13 @@ (..log/2 ..smallest)) (the .public (reciprocal it) - (-> Frac - Frac) + (-> Dec + Dec) (../ it +1.0)) (the .public (bits it) - (-> Frac + (-> Dec I64) (.i64 (cond (..not_a_number? it) ..not_a_number_bits @@ -590,8 +590,8 @@ ..log/2 ..floor (..min ..max_exponent)) - min_gap (..- (//int.frac ..min_exponent) exponent) - power (|> (//nat.frac ..mantissa_size) + min_gap (..- (//int.dec ..min_exponent) exponent) + power (|> (//nat.dec ..mantissa_size) (..+ (..min +0.0 min_gap)) (..- exponent)) max_gap (..- ..max_exponent power) @@ -628,7 +628,7 @@ (the .public (of_bits it) (-> I64 - Frac) + Dec) (when [(is Nat (..exponent it)) (is Nat (..mantissa it)) (is Nat (..sign it))] @@ -661,8 +661,8 @@ (//int.- (.int ..mantissa_size)))] [(//i64.one ..mantissa_size M) (|> E (//nat.- ..double_bias) (//nat.- ..mantissa_size) .int)]) - exponent (..pow (//int.frac power) +2.0)] - (|> (//nat.frac mantissa) + exponent (..pow (//int.dec power) +2.0)] + (|> (//nat.dec mantissa) (..* exponent) (..* sign))))) @@ -695,7 +695,7 @@ (with_template [ ] [(the .public - (Codec Text Frac) + (Codec Text Dec) (implementation (the (encoded value) (let [bits (..bits value) @@ -747,13 +747,13 @@ ) (the .public hash - (Hash Frac) + (Hash Dec) (implementation (the equivalence ..equivalence) (the hash ..bits))) (the .public (approximately? margin_of_error standard value) - (-> Frac Frac Frac + (-> Dec Dec Dec Bit) (|> value (..- standard) @@ -761,7 +761,7 @@ (..< margin_of_error))) (the .public (mod divisor dividend) - (-> Frac Frac Frac) + (-> Dec Dec Dec) (let [remainder (..% divisor dividend)] (if (or (and (..< +0.0 divisor) (..> +0.0 remainder)) @@ -772,17 +772,17 @@ (with_template [ ] [(the .public - (-> Frac - Frac) + (-> Dec + Dec) (* )) (the .public - (-> Frac - Frac) + (-> Dec + Dec) (/ )) (the .public - (Codec Text Frac) + (Codec Text Dec) (implementation (the encoded (|>> diff --git a/stdlib/source/library/lux/math/number/int.lux b/stdlib/source/library/lux/math/number/int.lux index c62485560b..f9371660bc 100644 --- a/stdlib/source/library/lux/math/number/int.lux +++ b/stdlib/source/library/lux/math/number/int.lux @@ -185,9 +185,9 @@ _ (|> a (/ (gcd a b)) (* b))))) -(the .public frac +(the .public dec (-> Int - Frac) + Dec) (|>> .int_f64#)) (the .public equivalence diff --git a/stdlib/source/library/lux/math/number/nat.lux b/stdlib/source/library/lux/math/number/nat.lux index 06f1fb2559..bb80b9a2d2 100644 --- a/stdlib/source/library/lux/math/number/nat.lux +++ b/stdlib/source/library/lux/math/number/nat.lux @@ -166,9 +166,9 @@ Bit) (|>> ..even? not)) -(the .public frac +(the .public dec (-> Nat - Frac) + Dec) (|>> .int .int_f64#)) (the .public equivalence diff --git a/stdlib/source/library/lux/math/number/rev.lux b/stdlib/source/library/lux/math/number/rev.lux index 5cad888020..74e6820ee9 100644 --- a/stdlib/source/library/lux/math/number/rev.lux +++ b/stdlib/source/library/lux/math/number/rev.lux @@ -193,17 +193,17 @@ (the mantissa (-> (I64 Any) - Frac) + Dec) (|>> (.i64_right# 11) .int_f64#)) -(the frac_denominator +(the dec_denominator (..mantissa -1)) -(the .public frac +(the .public dec (-> Rev - Frac) - (|>> ..mantissa (.f64_/# ..frac_denominator))) + Dec) + (|>> ..mantissa (.f64_/# ..dec_denominator))) (the .public equivalence (Equivalence Rev) diff --git a/stdlib/source/library/lux/math/random.lux b/stdlib/source/library/lux/math/random.lux index c544ea0bdc..fee1ea0f40 100644 --- a/stdlib/source/library/lux/math/random.lux +++ b/stdlib/source/library/lux/math/random.lux @@ -31,7 +31,7 @@ [number (.only hex) ["n" nat] ["i" int] - ["f" frac] + ["d" dec] ["r" ratio] ["c" complex] ["[0]" i64]]] @@ -146,21 +146,21 @@ [rev Rev .rev] ) -(the .public frac - (Random Frac) +(the .public dec + (Random Dec) (of ..functor each (|>> .i64 - f.of_bits) + d.of_bits) ..nat)) -(the .public safe_frac - (Random Frac) +(the .public safe_dec + (Random Dec) (let [mantissa_range (.int (i64.left_shifted 53 1)) - mantissa_max (i.frac (-- mantissa_range))] + mantissa_max (i.dec (-- mantissa_range))] (of ..functor each (|>> (i.% mantissa_range) - i.frac - (f./ mantissa_max)) + i.dec + (d./ mantissa_max)) ..int))) (the .public (char set) @@ -209,7 +209,7 @@ (in ( left right))))] [ratio r.Ratio r.ratio ..nat] - [complex c.Complex c.complex ..safe_frac] + [complex c.Complex c.complex ..safe_dec] ) (the .public (and left right) diff --git a/stdlib/source/library/lux/meta/code.lux b/stdlib/source/library/lux/meta/code.lux index 600856ccab..e65dfc9c18 100644 --- a/stdlib/source/library/lux/meta/code.lux +++ b/stdlib/source/library/lux/meta/code.lux @@ -17,7 +17,7 @@ ["[0]" nat] ["[0]" int] ["[0]" rev] - ["[0]" frac]]] + ["[0]" dec]]] [meta ["[0]" location] ["[0]" symbol]]]]) @@ -27,7 +27,7 @@ ... {.#Nat Nat} ... {.#Int Int} ... {.#Rev Rev} -... {.#Frac Frac} +... {.#Dec Dec} ... {.#Text Text} ... {.#Symbol Symbol} ... {.#Form (List (w (Code' w)))} @@ -47,7 +47,7 @@ [nat Nat .#Nat] [int Int .#Int] [rev Rev .#Rev] - [frac Frac .#Frac] + [dec Dec .#Dec] [text Text .#Text] [symbol Symbol .#Symbol] [form (List Code) .#Form] @@ -73,7 +73,7 @@ [.#Nat nat.equivalence] [.#Int int.equivalence] [.#Rev rev.equivalence] - [.#Frac frac.equivalence] + [.#Dec dec.equivalence] [.#Text text.equivalence] [.#Symbol symbol.equivalence])) @@ -100,7 +100,7 @@ [.#Nat nat.decimal] [.#Int int.decimal] [.#Rev rev.decimal] - [.#Frac frac.decimal] + [.#Dec dec.decimal] [.#Symbol symbol.absolute])) [_ {.#Text value}] @@ -136,7 +136,7 @@ [.#Nat nat.decimal] [.#Int int.decimal] [.#Rev rev.decimal] - [.#Frac frac.decimal] + [.#Dec dec.decimal] [.#Symbol (symbol.relative module)])) [_ {.#Text value}] diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/analysis.lux b/stdlib/source/library/lux/meta/compiler/language/lux/analysis.lux index af1b15c9c3..0e6570b60c 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/analysis.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/analysis.lux @@ -26,8 +26,7 @@ [number ["n" nat] ["i" int] - ["r" rev] - ["f" frac]]] + ["r" rev]]] [meta ["[0]" location] ["[0]" configuration (.only Configuration)] @@ -147,7 +146,7 @@ [nat /simple.#Nat] [int /simple.#Int] [rev /simple.#Rev] - [frac /simple.#Frac] + [dec /simple.#Dec] [text /simple.#Text] ) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/analysis/coverage.lux b/stdlib/source/library/lux/meta/compiler/language/lux/analysis/coverage.lux index 4482b53b9e..fd57c3a3e5 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/analysis/coverage.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/analysis/coverage.lux @@ -4,7 +4,7 @@ (.require [library [lux (.except Variant Pattern - #Bit #Nat #Int #Rev #Frac #Text #Variant) + #Bit #Nat #Int #Rev #Dec #Text #Variant) [abstract [equivalence (.except)] ["[0]" monad (.only do)]] @@ -25,7 +25,7 @@ ["n" nat (.use "[1]#[0]" interval)] ["i" int] ["r" rev] - ["f" frac]]] + ["d" dec]]] [meta [macro ["^" pattern] @@ -54,7 +54,7 @@ {#Nat (Set Nat)} {#Int (Set Int)} {#Rev (Set Rev)} - {#Frac (Set Frac)} + {#Dec (Set Dec)} {#Text (Set Text)} {#Variant (Variant' @)} {#Seq @ @} @@ -101,7 +101,7 @@ ([#Nat] [#Int] [#Rev] - [#Frac] + [#Dec] [#Text]) [{#Variant allR casesR} {#Variant allS casesS}] @@ -141,7 +141,7 @@ ([#Nat %.nat] [#Int %.int] [#Rev %.rev] - [#Frac %.frac] + [#Dec %.dec] [#Text %.text]) {#Variant ?max_cases cases} @@ -183,7 +183,7 @@ ([//simple.#Nat #Nat n.hash] [//simple.#Int #Int i.hash] [//simple.#Rev #Rev r.hash] - [//simple.#Frac #Frac f.hash] + [//simple.#Dec #Dec d.hash] [//simple.#Text #Text text.hash]) ... Bits are the exception, since there is only "#1" and @@ -289,7 +289,7 @@ ([#Nat] [#Int] [#Rev] - [#Frac] + [#Dec] [#Text]) [{#Variant addition'} {#Variant so_far'}] diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/analysis/pattern.lux b/stdlib/source/library/lux/meta/compiler/language/lux/analysis/pattern.lux index 57fa0ca697..df6e25513e 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/analysis/pattern.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/analysis/pattern.lux @@ -81,7 +81,7 @@ [nat //simple.#Nat] [int //simple.#Int] [rev //simple.#Rev] - [frac //simple.#Frac] + [dec //simple.#Dec] [text //simple.#Text] ) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/analysis/simple.lux b/stdlib/source/library/lux/meta/compiler/language/lux/analysis/simple.lux index d7b5c79e43..00caa93a38 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/analysis/simple.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/analysis/simple.lux @@ -3,7 +3,7 @@ (.require [library - [lux (.except #Bit #Nat #Int #Rev #Frac #Text) + [lux (.except #Bit #Nat #Int #Rev #Dec #Text) [abstract [equivalence (.only Equivalence)]] [data @@ -15,7 +15,7 @@ ["n" nat] ["i" int] ["r" rev] - ["f" frac]]] + ["d" dec]]] [meta [macro ["^" pattern]]]]]) @@ -27,7 +27,7 @@ {#Nat Nat} {#Int Int} {#Rev Rev} - {#Frac Frac} + {#Dec Dec} {#Text Text})) (the .public equivalence @@ -45,7 +45,7 @@ [#Nat n.=] [#Int i.=] [#Rev r.=] - [#Frac f.=] + [#Dec d.=] [#Text text#=]) _ @@ -64,5 +64,5 @@ [#Nat %.nat] [#Int %.int] [#Rev %.rev] - [#Frac %.frac] + [#Dec %.dec] [#Text %.text]))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/analysis.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/analysis.lux index abb3126087..a074d8a892 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/analysis.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/analysis.lux @@ -166,7 +166,7 @@ ([.#Text /simple.text] [.#Nat /simple.nat] [.#Bit /simple.bit] - [.#Frac /simple.frac] + [.#Dec /simple.dec] [.#Int /simple.int] [.#Rev /simple.rev]) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/analysis/simple.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/analysis/simple.lux index 801dfb1f0a..bb6226649a 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/analysis/simple.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/analysis/simple.lux @@ -26,7 +26,7 @@ [nat .Nat /simple.#Nat] [int .Int /simple.#Int] [rev .Rev /simple.#Rev] - [frac .Frac /simple.#Frac] + [dec .Dec /simple.#Dec] [text .Text /simple.#Text] ) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/analysis/when.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/analysis/when.lux index 439b1adaf7..554d7f2ebb 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/analysis/when.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/analysis/when.lux @@ -298,7 +298,7 @@ [Nat {.#Nat pattern_value} {/simple.#Nat pattern_value}] [Int {.#Int pattern_value} {/simple.#Int pattern_value}] [Rev {.#Rev pattern_value} {/simple.#Rev pattern_value}] - [Frac {.#Frac pattern_value} {/simple.#Frac pattern_value}] + [Dec {.#Dec pattern_value} {/simple.#Dec pattern_value}] [Text {.#Text pattern_value} {/simple.#Text pattern_value}] [Any {.#Tuple {.#End}} {/simple.#Unit}]) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/jvm.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/jvm.lux index 807aae1e9b..26edb56276 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/jvm.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/jvm.lux @@ -2644,8 +2644,8 @@ ... [.#Int jvm.short [.i64 i32.i32 constant.integer pool.integer]] ... [.#Int jvm.int [.i64 i32.i32 constant.integer pool.integer]] [.#Int jvm.long [constant.long pool.long]] - ... [.#Frac jvm.float [ffi.as_double ffi.double_to_float constant.float pool.float]] - [.#Frac jvm.double [constant.double pool.double]] + ... [.#Dec jvm.float [ffi.as_double ffi.double_to_float constant.float pool.float]] + [.#Dec jvm.double [constant.double pool.double]] [.#Nat jvm.char [.i64 i32.i32 constant.integer pool.integer]] [.#Text (jvm.class "java.lang.String" (list)) [pool.string]] ) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/lua.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/lua.lux index 067d1515f2..8dbccc9533 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/lua.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/lua.lux @@ -238,11 +238,11 @@ [(all <>.and .any .any) (function (_ extension phase archive [powerC baseC]) (do [! phase.monad] - [powerA (analysis/type.expecting Frac + [powerA (analysis/type.expecting Dec (phase archive powerC)) - baseA (analysis/type.expecting Frac + baseA (analysis/type.expecting Dec (phase archive baseC)) - _ (analysis/type.inference Frac) + _ (analysis/type.inference Dec) @ meta.location] (in [@ {analysis.#Extension (/.translation extension) (list powerA baseA)}])))])) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/lux.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/lux.lux index c4bcef2255..ff326e1f13 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/lux.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/lux.lux @@ -374,23 +374,23 @@ (install "int_/#" (binary Int Int Int)) (install "int_%#" (binary Int Int Int)) - (install "int_f64#" (unary Int Frac)) + (install "int_f64#" (unary Int Dec)) (install "int_char#" (unary Int Text)))) -(the with_frac_extensions +(the with_dec_extensions (-> Bundle Bundle) - (|>> (install "f64_+#" (binary Frac Frac Frac)) - (install "f64_-#" (binary Frac Frac Frac)) - (install "f64_*#" (binary Frac Frac Frac)) - (install "f64_/#" (binary Frac Frac Frac)) - (install "f64_%#" (binary Frac Frac Frac)) - (install "f64_=#" (binary Frac Frac Bit)) - (install "f64_<#" (binary Frac Frac Bit)) + (|>> (install "f64_+#" (binary Dec Dec Dec)) + (install "f64_-#" (binary Dec Dec Dec)) + (install "f64_*#" (binary Dec Dec Dec)) + (install "f64_/#" (binary Dec Dec Dec)) + (install "f64_%#" (binary Dec Dec Dec)) + (install "f64_=#" (binary Dec Dec Bit)) + (install "f64_<#" (binary Dec Dec Bit)) - (install "f64_int#" (unary Frac Int)) - (install "f64_encoded#" (unary Frac Text)) - (install "f64_decoded#" (unary Text (type (Maybe Frac)))))) + (install "f64_int#" (unary Dec Int)) + (install "f64_encoded#" (unary Dec Text)) + (install "f64_decoded#" (unary Text (type (Maybe Dec)))))) (the with_text_extensions (-> Bundle @@ -411,5 +411,5 @@ with_text_extensions with_i64_extensions with_int_extensions - with_frac_extensions + with_dec_extensions )) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/declaration/jvm.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/declaration/jvm.lux index d763a983f6..9b4cc82d25 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/declaration/jvm.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/declaration/jvm.lux @@ -246,8 +246,8 @@ ... [.#Int type.short [.i64 i32.i32 constant.integer pool.integer]] ... [.#Int type.int [.i64 i32.i32 constant.integer pool.integer]] [.#Int type.long [constant.long pool.long]] - ... [.#Frac type.float [ffi.as_double ffi.double_to_float constant.float pool.float]] - [.#Frac type.double [constant.double pool.double]] + ... [.#Dec type.float [ffi.as_double ffi.double_to_float constant.float pool.float]] + [.#Dec type.double [constant.double pool.double]] [.#Nat type.char [.i64 i32.i32 constant.integer pool.integer]] [.#Text (type.class "java.lang.String" (list)) [pool.string]] ) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/c++/common.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/c++/common.lux index 2f7dcc91ba..47dace8296 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/c++/common.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/c++/common.lux @@ -18,7 +18,6 @@ ["[0]" dictionary]]] [math [number - ["f" frac] ["[0]" i32]]] [meta [compiler diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/common_lisp/common.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/common_lisp/common.lux index c171c42cb2..d5034b0635 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/common_lisp/common.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/common_lisp/common.lux @@ -18,9 +18,6 @@ ["[0]" dictionary] ["[0]" set] ["[0]" list (.use "[1]#[0]" functor mix)]]] - [math - [number - ["f" frac]]] [meta [target ["_" common_lisp (.only Expression)]]]]] diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/js/common.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/js/common.lux index ab0f631a03..7e2667f614 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/js/common.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/js/common.lux @@ -15,9 +15,6 @@ [collection ["[0]" list (.use "[1]#[0]" functor mix)] ["[0]" dictionary]]] - [math - [number - ["f" frac]]] [meta [macro ["^" pattern]] diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/jvm/common.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/jvm/common.lux index 5cb03fae71..351e5d3981 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/jvm/common.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/jvm/common.lux @@ -18,7 +18,6 @@ ["[0]" dictionary]]] [math [number - ["f" frac] ["[0]" i32]]] [meta [compiler @@ -265,7 +264,7 @@ [f64::decode (_.checkcast $String) - ///runtime.decode_frac] + ///runtime.decode_dec] ) (the with_i64_extensions @@ -292,7 +291,7 @@ (dictionary.has "int_f64#|translation" (unary ..i64::f64)) (dictionary.has "int_char#|translation" (unary ..i64::char)))) -(the with_frac_extensions +(the with_dec_extensions (-> Bundle Bundle) (|>> (dictionary.has "f64_+#|translation" (binary ..f64::+)) @@ -476,5 +475,5 @@ with_text_extensions with_i64_extensions with_int_extensions - with_frac_extensions + with_dec_extensions )) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/lua/common.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/lua/common.lux index 1739f83a37..17019376c1 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/lua/common.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/lua/common.lux @@ -18,9 +18,6 @@ [collection ["[0]" dictionary] ["[0]" list (.use "[1]#[0]" functor mix)]]] - [math - [number - ["f" frac]]] [meta [macro ["^" pattern]] @@ -180,7 +177,7 @@ (Unary Expression) (|>> list _.apply (|> (_.var "tonumber")) _.return (_.closure (list)) //runtime.lux//try)) -(the with_frac_extensions +(the with_dec_extensions (-> Bundle Bundle) (|>> (dictionary.has "f64_+#|translation" (binary (product.uncurried _.+))) (dictionary.has "f64_-#|translation" (binary (product.uncurried _.-))) @@ -252,7 +249,7 @@ with_basic_extensions with_i64_extensions with_int_extensions - with_frac_extensions + with_dec_extensions with_text_extensions with_io_extensions )) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/php/common.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/php/common.lux index 186c2d982c..5075d0a843 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/php/common.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/php/common.lux @@ -18,9 +18,6 @@ ["[0]" dictionary] ["[0]" set] ["[0]" list (.use "[1]#[0]" functor mix)]]] - [math - [number - ["f" frac]]] [meta [target ["_" php (.only Expression)]]]]] diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/python/common.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/python/common.lux index 9dc871cd10..d4decafe4b 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/python/common.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/python/common.lux @@ -18,9 +18,6 @@ [collection ["[0]" dictionary] ["[0]" list (.use "[1]#[0]" functor mix)]]] - [math - [number - ["f" frac]]] [meta [macro ["^" pattern]] @@ -196,7 +193,7 @@ (dictionary.has "int_char#|translation" (unary //runtime.i64::char)) )) -(the with_frac_extensions +(the with_dec_extensions (-> Bundle Bundle) (|>> (dictionary.has "f64_+#|translation" (binary (product.uncurried _.+))) (dictionary.has "f64_-#|translation" (binary (product.uncurried _.-))) @@ -255,7 +252,7 @@ with_basic_extensions with_i64_extensions with_int_extensions - with_frac_extensions + with_dec_extensions with_text_extensions with_io_extensions )) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/r/common.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/r/common.lux index a211fab147..4e20338ed2 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/r/common.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/r/common.lux @@ -18,9 +18,6 @@ ["[0]" dictionary] ["[0]" set] ["[0]" list (.use "[1]#[0]" functor mix)]]] - [math - [number - ["f" frac]]] [meta [target ["_" r (.only Expression)]]]]] diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/ruby/common.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/ruby/common.lux index 1314f99eca..1b35f66247 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/ruby/common.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/ruby/common.lux @@ -18,9 +18,6 @@ [collection ["[0]" dictionary] ["[0]" list (.use "[1]#[0]" functor mix)]]] - [math - [number - ["f" frac]]] [meta [macro ["^" pattern]] diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/scheme/common.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/scheme/common.lux index 05e00d8efd..1de216d0d1 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/scheme/common.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/scheme/common.lux @@ -18,9 +18,6 @@ ["[0]" dictionary] ["[0]" set] ["[0]" list (.use "[1]#[0]" functor mix)]]] - [math - [number - ["f" frac]]] [meta [target ["_" scheme (.only Expression)]]]]] diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/synthesis.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/synthesis.lux index 1f90e186e0..c0a2d69cca 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/synthesis.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/synthesis.lux @@ -48,8 +48,8 @@ (^.with_template [ ] [{ value} { value}]) - ([///simple.#Bit /simple.#Bit] - [///simple.#Frac /simple.#F64] + ([///simple.#Bit /simple.#Bit] + [///simple.#Dec /simple.#F64] [///simple.#Text /simple.#Text]) (^.with_template [ ] diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/synthesis/variable.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/synthesis/variable.lux index 369e074c8a..a960048089 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/synthesis/variable.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/synthesis/variable.lux @@ -303,7 +303,7 @@ [redundancy elses])] (in [redundancy { [[test then] elses]}]))]) ([/.#I64_Fork I64] - [/.#F64_Fork Frac] + [/.#F64_Fork Dec] [/.#Text_Fork Text]) {/.#Bind register} diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/synthesis/when.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/synthesis/when.lux index aaa77ce455..9a501a426c 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/synthesis/when.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/synthesis/when.lux @@ -20,7 +20,7 @@ [number ["n" nat] ["[0]" i64] - ["[0]" frac]]] + ["[0]" dec]]] [meta [macro ["^" pattern]]]]] @@ -69,7 +69,7 @@ ([///simple.#Nat /.#I64_Fork .i64] [///simple.#Int /.#I64_Fork .i64] [///simple.#Rev /.#I64_Fork .i64] - [///simple.#Frac /.#F64_Fork |>] + [///simple.#Dec /.#F64_Fork |>] [///simple.#Text /.#Text_Fork |>])) {///pattern.#Bind register} @@ -189,7 +189,7 @@ [[{ new_fork} { old_fork}] { (..weave_fork weave new_fork old_fork)}]) ([/.#I64_Fork i64.equivalence] - [/.#F64_Fork frac.equivalence] + [/.#F64_Fork dec.equivalence] [/.#Text_Fork text.equivalence]) (^.with_template [ ] diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/c++/primitive.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/c++/primitive.lux index 99a8dc9a92..f6a2db2fee 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/c++/primitive.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/c++/primitive.lux @@ -35,12 +35,12 @@ (runtime.simple runtime.I64))) (the .public f64' - (-> Frac + (-> Dec _.Expression) _.double) (the .public f64 - (-> Frac + (-> Dec _.Expression) (|>> ..f64' (runtime.simple runtime.F64))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp/extension/common.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp/extension/common.lux index 95c6318922..444631f6e6 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp/extension/common.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp/extension/common.lux @@ -10,8 +10,6 @@ ["[0]" function]] [data ["[0]" product] - [number - ["f" frac]] [collection ["[0]" dictionary]]] [meta diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp/primitive.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp/primitive.lux index 5e7c3c7b01..f6c111192a 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp/primitive.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp/primitive.lux @@ -17,7 +17,7 @@ (|>> .int _.int)) (the .public f64 - (-> Frac (Expression Any)) + (-> Dec (Expression Any)) _.double) (the .public text diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/primitive.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/primitive.lux index db69a0d2ea..b928b353e9 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/primitive.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/primitive.lux @@ -90,7 +90,7 @@ ("static" doubleToRawLongBits [double] long)) (the double_bits - (-> Frac + (-> Dec Int) (|>> [] java/lang/Double::doubleToRawLongBits ffi.of_long)) @@ -100,7 +100,7 @@ (double_bits +0.0)) (the .public (f64 value) - (-> Frac + (-> Dec (Bytecode Any)) (when value (^.with_template [ ] diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/runtime.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/runtime.lux index 53c9b4aaa3..045870c46b 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/runtime.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/runtime.lux @@ -221,19 +221,19 @@ _.areturn ))) -(the decode_frac::name "decode_frac") -(the decode_frac::type (type.method [(list) (list //type.text) //type.variant (list)])) -(the .public decode_frac (..procedure ..decode_frac::name ..decode_frac::type)) +(the decode_dec::name "decode_dec") +(the decode_dec::type (type.method [(list) (list //type.text) //type.variant (list)])) +(the .public decode_dec (..procedure ..decode_dec::name ..decode_dec::type)) -(the decode_frac::method - (method.method ..modifier ..decode_frac::name - .false ..decode_frac::type +(the decode_dec::method + (method.method ..modifier ..decode_dec::name + .false ..decode_dec::type (list) {.#Some (..risky (all _.composite _.aload_0 - (_.invokestatic //type.frac "parseDouble" (type.method [(list) (list //type.text) type.double (list)])) + (_.invokestatic //type.dec "parseDouble" (type.method [(list) (list //type.text) type.double (list)])) (//value.boxed type.double) ))})) @@ -579,7 +579,7 @@ (name.internal (..reflection ^Object)) (list) (list) (let [[left_projection::method right_projection::method] projection::method2] - (list ..decode_frac::method + (list ..decode_dec::method ..variant::method ..pm_failure::method diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/type.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/type.lux index ca1ec80837..67e0b16742 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/type.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/type.lux @@ -10,7 +10,7 @@ [jvm ["[0]" type]]]]]]]) -(the .public frac (type.class "java.lang.Double" (list))) +(the .public dec (type.class "java.lang.Double" (list))) (the .public text (type.class "java.lang.String" (list))) (the .public value (type.class "java.lang.Object" (list))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/when.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/when.lux index 50a9d6de36..fbde8bfd13 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/when.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/when.lux @@ -165,7 +165,7 @@ fork!))))] [path|i64_fork (I64 Any) (//value.primitive type.long) _.dup2 _.pop2 ..long _.lcmp _.ifne] - [path|f64_fork Frac (//value.primitive type.double) _.dup2 _.pop2 _.double _.dcmpl _.ifne] + [path|f64_fork Dec (//value.primitive type.double) _.dup2 _.pop2 _.double _.dcmpl _.ifne] [path|text_fork Text (of _.monad in []) _.dup _.pop _.string ..equals@Object _.ifeq] ) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/lua/primitive.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/lua/primitive.lux index b5dde779c8..2eecee14f3 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/lua/primitive.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/lua/primitive.lux @@ -16,6 +16,6 @@ [bit Bit _.boolean] [i64 (I64 Any) (|>> .int _.int)] - [f64 Frac _.float] + [f64 Dec _.float] [text Text _.string] ) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/extension/common.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/extension/common.lux index 8102489818..963e7333f4 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/extension/common.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/extension/common.lux @@ -11,8 +11,6 @@ [data ["[0]" product] ["[0]" text] - [number - ["f" frac]] [collection ["[0]" dictionary]]] [meta @@ -57,12 +55,12 @@ (bundle.install "*" (binary (product.uncurried _.*))) (bundle.install "/" (binary (product.uncurried _./))) (bundle.install "%" (binary (product.uncurried _.%))) - (bundle.install "frac" (unary _.floatval/1)) + (bundle.install "dec" (unary _.floatval/1)) (bundle.install "char" (unary _.chr/1))))) -(the frac_procs +(the dec_procs Bundle - (<| (bundle.prefix "frac") + (<| (bundle.prefix "dec") (|> bundle.empty (bundle.install "+" (binary (product.uncurried _.+))) (bundle.install "-" (binary (product.uncurried _.-))) @@ -110,7 +108,7 @@ (|> lux_procs (dictionary.composite i64_procs) (dictionary.composite int_procs) - (dictionary.composite frac_procs) + (dictionary.composite dec_procs) (dictionary.composite text_procs) (dictionary.composite io_procs) ))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/primitive.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/primitive.lux index 7230dd5498..fa4ee9110b 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/primitive.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/primitive.lux @@ -6,7 +6,7 @@ [lux (.except i64) [math [number - ["[0]" frac]]] + ["[0]" dec]]] [meta [target ["_" php (.only Literal Expression)]]]]] @@ -26,7 +26,7 @@ (_.bit_or l32)))) (the .public f64 - (-> Frac Literal) + (-> Dec Literal) _.float) (the .public text diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/python/primitive.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/python/primitive.lux index 10232cc0d5..fae5af0b86 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/python/primitive.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/python/primitive.lux @@ -18,6 +18,6 @@ [Bit bit _.bool] [(I64 Any) i64 (|>> .int _.int //runtime.i64::64)] - [Frac f64 _.float] + [Dec f64 _.float] [Text text _.unicode] ) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/python/runtime.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/python/runtime.lux index fdca70ec12..778613d246 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/python/runtime.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/python/runtime.lux @@ -21,7 +21,7 @@ ["[0]" sequence]]] [math [number (.only hex) - ["f" frac] + ["d" dec] ["[0]" i64]]] ["[0]" meta (.only) ["[0]" version] @@ -424,10 +424,10 @@ (f64::/ parameter subject) (_.return (_.? (_.= (_.float +0.0) parameter) (<| (_.? (_.> (_.float +0.0) subject) - (_.float f.positive_infinity)) + (_.float d.positive_infinity)) (_.? (_.< (_.float +0.0) subject) - (_.float f.negative_infinity)) - (_.float f.not_a_number)) + (_.float d.negative_infinity)) + (_.float d.not_a_number)) (_./ parameter subject)))) (runtime diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/primitive.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/primitive.lux index e467a653ab..ff40fd7048 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/primitive.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/primitive.lux @@ -17,6 +17,6 @@ [bit Bit _.bool] [i64 (I64 Any) (|>> .int //runtime.i64)] - [f64 Frac _.float] + [f64 Dec _.float] [text Text _.string] ) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/procedure/common.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/procedure/common.lux index 228ed5bc2d..72f263f162 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/procedure/common.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/procedure/common.lux @@ -145,9 +145,9 @@ Nullary ( ))] - [frac//smallest Double::MIN_VALUE r.float] - [frac//min (f/* -1.0 Double::MAX_VALUE) r.float] - [frac//max Double::MAX_VALUE r.float] + [dec//smallest Double::MIN_VALUE r.float] + [dec//min (f/* -1.0 Double::MAX_VALUE) r.float] + [dec//max Double::MAX_VALUE r.float] ) (with_template [ ] @@ -167,13 +167,13 @@ Binary ( paramO subjectO))] - [frac//add r.+] - [frac//sub r.-] - [frac//mul r.*] - [frac//div r./] - [frac//rem r.%%] - [frac//= r.=] - [frac//< r.<] + [dec//add r.+] + [dec//sub r.-] + [dec//mul r.*] + [dec//div r./] + [dec//rem r.%%] + [dec//= r.=] + [dec//< r.<] [text//= r.=] [text//< r.<] @@ -206,30 +206,30 @@ (install "%" (binary int//rem)) (install "=" (binary int//=)) (install "<" (binary int//<)) - (install "to-frac" (unary runtimeT.int//float)) + (install "to-dec" (unary runtimeT.int//float)) (install "char" (unary int//char))))) -(the (frac//encode value) +(the (dec//encode value) (-> Expression Expression) (r.apply (list (r.string "%f") value) (r.global "sprintf"))) -(the frac_procs +(the dec_procs Bundle - (<| (prefix "frac") + (<| (prefix "dec") (|> (dict.empty text.Hash) - (install "+" (binary frac//add)) - (install "-" (binary frac//sub)) - (install "*" (binary frac//mul)) - (install "/" (binary frac//div)) - (install "%" (binary frac//rem)) - (install "=" (binary frac//=)) - (install "<" (binary frac//<)) - (install "smallest" (nullary frac//smallest)) - (install "min" (nullary frac//min)) - (install "max" (nullary frac//max)) + (install "+" (binary dec//add)) + (install "-" (binary dec//sub)) + (install "*" (binary dec//mul)) + (install "/" (binary dec//div)) + (install "%" (binary dec//rem)) + (install "=" (binary dec//=)) + (install "<" (binary dec//<)) + (install "smallest" (nullary dec//smallest)) + (install "min" (nullary dec//min)) + (install "max" (nullary dec//max)) (install "to-int" (unary (apply1 (r.global "as.integer")))) - (install "encode" (unary frac//encode)) - (install "decode" (unary runtimeT.frac//decode))))) + (install "encode" (unary dec//encode)) + (install "decode" (unary runtimeT.dec//decode))))) ... [[Text]] (the (text//concat [subjectO paramO]) @@ -289,7 +289,7 @@ (|> lux_procs (dict.composite bit_procs) (dict.composite int_procs) - (dict.composite frac_procs) + (dict.composite dec_procs) (dict.composite text_procs) (dict.composite io_procs) ))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/runtime.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/runtime.lux index 882a19b822..3879b9a006 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/runtime.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/runtime.lux @@ -739,7 +739,7 @@ )) (runtime - (frac::decode input) + (dec::decode input) (with_vars [output] (all _.then (_.set! output (_.apply (list input) (_.var "as.numeric"))) @@ -747,10 +747,10 @@ ..none (..some output))))) -(the runtime//frac +(the runtime//dec Expression (all _.then - @frac::decode + @dec::decode )) (the ++ @@ -865,7 +865,7 @@ runtime//lux runtime//i64 runtime//adt - runtime//frac + runtime//dec runtime//text runtime//array runtime//io diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/ruby/primitive.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/ruby/primitive.lux index d139e89a48..e976bc6283 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/ruby/primitive.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/ruby/primitive.lux @@ -16,6 +16,6 @@ [Bit bit _.bool] [(I64 Any) i64 (|>> .int _.int)] - [Frac f64 _.float] + [Dec f64 _.float] [Text text _.string] ) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme/extension/common.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme/extension/common.lux index 3ef50ef0df..de3a0f73ad 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme/extension/common.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme/extension/common.lux @@ -9,8 +9,6 @@ [data ["[0]" product] ["[0]" text] - [number (.only hex) - ["f" frac]] [collection ["[0]" list (.use "[1]#[0]" functor)] ["dict" dictionary (.only Dictionary)]]] @@ -132,7 +130,7 @@ (bundle.install "<" (binary f64::<)) (bundle.install "i64" (unary _.exact/1)) (bundle.install "encode" (unary _.number->string/1)) - (bundle.install "decode" (unary ///runtime.frac//decode))))) + (bundle.install "decode" (unary ///runtime.dec//decode))))) (the (text::char [subjectO paramO]) Binary diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme/primitive.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme/primitive.lux index 9ac0ffae89..e3deb596ea 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme/primitive.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme/primitive.lux @@ -15,6 +15,6 @@ [bit Bit _.bool] [i64 (I64 Any) (|>> .int _.int)] - [f64 Frac _.float] + [f64 Dec _.float] [text Text _.string] ) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/syntax.lux b/stdlib/source/library/lux/meta/compiler/language/lux/syntax.lux index 678474ee93..9788d9f4e1 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/syntax.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/syntax.lux @@ -55,7 +55,7 @@ ["n" nat] ["[0]" int] ["[0]" rev] - ["[0]" frac]]]]]) + ["[0]" dec]]]]]) (the declaration_name (syntax (_ [[name parameters] (.form (<>.and .any (<>.some .any)))]) @@ -152,7 +152,7 @@ ["+" positive_sign] ["-" negative_sign] - ["." frac_separator] + ["." dec_separator] ... The parts of a name are separated by a single mark. ... E.g. module.short. @@ -370,20 +370,20 @@ 0) (with_expansions [ (these (!number_output source_code start end int.decimal .#Int)) - (these (!number_output source_code start end frac.decimal .#Frac)) - (!failure ..frac_parser where offset source_code) - (static ..frac_separator) + (these (!number_output source_code start end dec.decimal .#Dec)) + (!failure ..dec_parser where offset source_code) + (static ..dec_separator) (with_template [] [(,, (static ))] [..positive_sign] [..negative_sign])] - (these (inlined (frac_parser source_code//size start where offset source_code) + (these (inlined (dec_parser source_code//size start where offset source_code) (-> Nat Nat Location Offset Text (Either [Source Text] [Source Code])) (loop (again [end offset exponent (static ..no_exponent)]) - (<| (!with_char+ source_code//size source_code end char/0 ) + (<| (!with_char+ source_code//size source_code end char/0 ) (!if_digit?+ char/0 (again (!++ end) exponent) @@ -399,9 +399,9 @@ ))] ... else ))) - )] + )] - )))) + )))) (inlined (signed_parser source_code//size start where offset source_code) (-> Nat Nat Location Offset Text @@ -411,8 +411,8 @@ (!if_digit?+ char (again (!++ end)) - [[] - (frac_parser source_code//size start where (!++ end) source_code)] + [[] + (dec_parser source_code//size start where (!++ end) source_code)] ))))) ) @@ -557,9 +557,9 @@ [(,, (static ..text_delimiter))] (text_parser where (!++ offset/0) source_code) - ... Coincidentally (= ..symbol_separator ..frac_separator) + ... Coincidentally (= ..symbol_separator ..dec_separator) [(,, (static ..symbol_separator)) - ... (,, (static ..frac_separator)) + ... (,, (static ..dec_separator)) ] ... It's either a Rev, a symbol, or a comment. (with_expansions [ (rev_parser source_code//size offset/0 where (!++ offset/1) source_code) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/synthesis.lux b/stdlib/source/library/lux/meta/compiler/language/lux/synthesis.lux index 6e74c9f2c2..f0074419e7 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/synthesis.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/synthesis.lux @@ -27,7 +27,7 @@ [number ["n" nat] ["i" int] - ["f" frac] + ["d" dec] ["[0]" i64]]] [meta [macro @@ -82,7 +82,7 @@ {#Access Access} {#Bit_Fork Bit (Path' of) (Maybe (Path' of))} {#I64_Fork (Fork I64 (Path' of))} - {#F64_Fork (Fork Frac (Path' of))} + {#F64_Fork (Fork Dec (Path' of))} {#Text_Fork (Fork Text (Path' of))} {#Seq (Path' of) (Path' of)} {#Alt (Path' of) (Path' of)} @@ -363,7 +363,7 @@ (text.interposed " ") (text.enclosed ["(? " ")"]))]) ([#I64_Fork (|>> .int %.int)] - [#F64_Fork %.frac] + [#F64_Fork %.dec] [#Text_Fork %.text]) {#Access it} @@ -497,7 +497,7 @@ {.#Item expected_item} {.#Item actual_item})]) ([#I64_Fork (is (Equivalence I64) i64.equivalence)] - [#F64_Fork f.equivalence] + [#F64_Fork d.equivalence] [#Text_Fork text.equivalence]) (^.with_template [ ] @@ -551,7 +551,7 @@ item_hash (product.hash when_hash (list.hash when_hash))] (n.* (of item_hash hash item)))]) ([11 #I64_Fork i64.hash] - [13 #F64_Fork f.hash] + [13 #F64_Fork d.hash] [17 #Text_Fork text.hash]) (^.with_template [ ] diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/synthesis/simple.lux b/stdlib/source/library/lux/meta/compiler/language/lux/synthesis/simple.lux index 64c336b1a8..f67f59ebff 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/synthesis/simple.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/synthesis/simple.lux @@ -18,7 +18,7 @@ ["[0]" i64 (.use "[1]#[0]" equivalence)] ["n" nat] ["i" int] - ["f" frac]]] + ["d" dec]]] [meta [macro ["^" pattern]]]]]) @@ -27,7 +27,7 @@ (Variant {#Bit Bit} {#I64 I64} - {#F64 Frac} + {#F64 Dec} {#Text Text})) (the .public (format it) @@ -37,7 +37,7 @@ [{ value} ( value)]) ([#Bit %.bit] - [#F64 %.frac] + [#F64 %.dec] [#Text %.text]) {#I64 value} @@ -52,7 +52,7 @@ [[{ expected'} { actual'}] ( expected' actual')]) ([#Bit bit#= %.bit] - [#F64 f.= %.frac] + [#F64 d.= %.dec] [#Text text#= %.text]) [{#I64 expected'} {#I64 actual'}] @@ -72,6 +72,6 @@ [{ value'} (n.* (of hash value'))]) ([2 #Bit bit.hash] - [3 #F64 f.hash] + [3 #F64 d.hash] [5 #Text text.hash] [7 #I64 i64.hash])))))) diff --git a/stdlib/source/library/lux/meta/compiler/target/c++.lux b/stdlib/source/library/lux/meta/compiler/target/c++.lux index 76f51b0cd9..70d28877e6 100644 --- a/stdlib/source/library/lux/meta/compiler/target/c++.lux +++ b/stdlib/source/library/lux/meta/compiler/target/c++.lux @@ -19,7 +19,7 @@ ["[0]" list (.use "[1]#[0]" functor monoid)]]] [math [number - ["f" frac]]] + ["d" dec]]] [meta [macro ["[0]" template]] @@ -137,19 +137,19 @@ <%)) (the .public double - (-> Frac + (-> Dec Pure) - (|>> (|.cond [(f.= f.positive_infinity)] + (|>> (|.cond [(d.= d.positive_infinity)] [(|.new "(+1.0/0.0)" [])] - [(f.= f.negative_infinity)] + [(d.= d.negative_infinity)] [(|.new "(-1.0/0.0)" [])] - [(f.= f.not_a_number)] + [(d.= d.not_a_number)] [(|.new "(0.0/0.0)" [])] ... else - [%.frac]) + [%.dec]) <%)) (.every .public Namespace diff --git a/stdlib/source/library/lux/meta/compiler/target/common_lisp.lux b/stdlib/source/library/lux/meta/compiler/target/common_lisp.lux index a527248b2f..05a641900b 100644 --- a/stdlib/source/library/lux/meta/compiler/target/common_lisp.lux +++ b/stdlib/source/library/lux/meta/compiler/target/common_lisp.lux @@ -13,7 +13,7 @@ ["[0]" list (.use "[1]#[0]" monad monoid)]]] [math [number - ["f" frac]]] + ["d" dec]]] [meta [macro ["[0]" template]] @@ -89,34 +89,34 @@ (|>> %.int nominal.abstraction)) (the .public float - (-> Frac Literal) - (|>> (pipe.cond [(f.= f.positive_infinity)] + (-> Dec Literal) + (|>> (pipe.cond [(d.= d.positive_infinity)] [(pipe.new "(/ 1.0 0.0)" [])] - [(f.= f.negative_infinity)] + [(d.= d.negative_infinity)] [(pipe.new "(/ -1.0 0.0)" [])] - [f.not_a_number?] + [d.not_a_number?] [(pipe.new "(/ 0.0 0.0)" [])] ... else - [%.frac]) + [%.dec]) nominal.abstraction)) (the .public (double value) - (-> Frac Literal) + (-> Dec Literal) (nominal.abstraction - (.cond (f.= f.positive_infinity value) + (.cond (d.= d.positive_infinity value) "(/ 1.0d0 0.0d0)" - (f.= f.negative_infinity value) + (d.= d.negative_infinity value) "(/ -1.0d0 0.0d0)" - (f.not_a_number? value) + (d.not_a_number? value) "(/ 0.0d0 0.0d0)" ... else - (.let [raw (%.frac value)] + (.let [raw (%.dec value)] (.if (text.contains? "E" raw) (text.replaced_once "E" "d" raw) (format raw "d0")))))) diff --git a/stdlib/source/library/lux/meta/compiler/target/js.lux b/stdlib/source/library/lux/meta/compiler/target/js.lux index 9c4ddbd5cb..07314860b7 100644 --- a/stdlib/source/library/lux/meta/compiler/target/js.lux +++ b/stdlib/source/library/lux/meta/compiler/target/js.lux @@ -15,7 +15,7 @@ [math [number ["i" int] - ["f" frac]]] + ["d" dec]]] [meta [macro ["[0]" template]] @@ -85,19 +85,19 @@ nominal.abstraction)) (the .public (number value) - (-> Frac Literal) + (-> Dec Literal) (nominal.abstraction - (cond (f.not_a_number? value) + (cond (d.not_a_number? value) "NaN" - (f.= f.positive_infinity value) + (d.= d.positive_infinity value) "Infinity" - (f.= f.negative_infinity value) + (d.= d.negative_infinity value) "-Infinity" ... else - (|> value %.frac ..expression)))) + (|> value %.dec ..expression)))) (the safe (-> Text Text) diff --git a/stdlib/source/library/lux/meta/compiler/target/jvm/bytecode.lux b/stdlib/source/library/lux/meta/compiler/target/jvm/bytecode.lux index d455c69a46..fbf7057680 100644 --- a/stdlib/source/library/lux/meta/compiler/target/jvm/bytecode.lux +++ b/stdlib/source/library/lux/meta/compiler/target/jvm/bytecode.lux @@ -675,7 +675,7 @@ (if (i.= ..negative_zero_float_bits (..float_bits value)) (..arbitrary_float value) - (when (|> value ffi.float_to_double (as Frac)) + (when (|> value ffi.float_to_double (as Dec)) (^.with_template [ ] [ (..bytecode $0 $1 @_ [])]) ([+0.0 _.fconst_0] @@ -704,14 +704,14 @@ ) (the (arbitrary_double value) - (-> Frac + (-> Dec (Bytecode Any)) (do ..monad [index (..lifted (//constant/pool.double (//constant.double value)))] (..bytecode $0 $2 @_ _.ldc2_w/double [index]))) (the double_bits - (-> Frac + (-> Dec Int) (|>> (as java/lang/Double) [] java/lang/Double::doubleToRawLongBits @@ -721,12 +721,12 @@ (..double_bits -0.0)) (the .public (double value) - (-> Frac + (-> Dec (Bytecode Any)) (if (i.= ..negative_zero_double_bits (..double_bits value)) (..arbitrary_double value) - (when (as Frac value) + (when (as Dec value) (^.with_template [ ] [ (..bytecode $0 $2 @_ [])]) ([+0.0 _.dconst_0] diff --git a/stdlib/source/library/lux/meta/compiler/target/jvm/constant.lux b/stdlib/source/library/lux/meta/compiler/target/jvm/constant.lux index cbe24eddaa..db822c2a18 100644 --- a/stdlib/source/library/lux/meta/compiler/target/jvm/constant.lux +++ b/stdlib/source/library/lux/meta/compiler/target/jvm/constant.lux @@ -19,7 +19,7 @@ ["[0]" i32 (.only I32)] ["[0]" i64] ["[0]" int] - ["[0]" frac]]] + ["[0]" dec]]] [meta [macro ["^" pattern] @@ -111,7 +111,7 @@ [integer Integer I32] [float Float java/lang/Float] [long Long .Int] - [double Double Frac] + [double Double Dec] [string String (Index UTF8)] ) @@ -194,7 +194,7 @@ [#Integer (..value_equivalence i32.equivalence)] [#Long (..value_equivalence int.equivalence)] [#Float (..value_equivalence float_equivalence)] - [#Double (..value_equivalence frac.equivalence)] + [#Double (..value_equivalence dec.equivalence)] [#Class ..class_equivalence] [#String (..value_equivalence //index.equivalence)] [#Field ..reference_equivalence] @@ -210,7 +210,7 @@ ... ... #Long ... (..value_equivalence int.equivalence) ... ... #Double - ... (..value_equivalence frac.equivalence) + ... (..value_equivalence dec.equivalence) ... ... #Class ... ..class_equivalence ... ... #String diff --git a/stdlib/source/library/lux/meta/compiler/target/jvm/constant/pool.lux b/stdlib/source/library/lux/meta/compiler/target/jvm/constant/pool.lux index 59b8a04594..49bb896290 100644 --- a/stdlib/source/library/lux/meta/compiler/target/jvm/constant/pool.lux +++ b/stdlib/source/library/lux/meta/compiler/target/jvm/constant/pool.lux @@ -23,7 +23,7 @@ [math [number ["[0]" int] - ["[0]" frac] + ["[0]" dec] ["[0]" i32]]]]] ["[0]" // (.only UTF8 String Class Integer Float Long Double Constant Name_And_Type Reference) [// @@ -150,7 +150,7 @@ [integer Integer //.#Integer (//.value_equivalence i32.equivalence)] [float Float //.#Float (//.value_equivalence //.float_equivalence)] [long Long //.#Long (//.value_equivalence int.equivalence)] - [double Double //.#Double (//.value_equivalence frac.equivalence)] + [double Double //.#Double (//.value_equivalence dec.equivalence)] [utf8 UTF8 //.#UTF8 text.equivalence] ) diff --git a/stdlib/source/library/lux/meta/compiler/target/lua.lux b/stdlib/source/library/lux/meta/compiler/target/lua.lux index 2e5806e0d4..480c5681b2 100644 --- a/stdlib/source/library/lux/meta/compiler/target/lua.lux +++ b/stdlib/source/library/lux/meta/compiler/target/lua.lux @@ -20,7 +20,7 @@ [number ["n" nat] ["i" int] - ["f" frac]]] + ["d" dec]]] [meta ["[0]" code (.only) ["<[1]>" \\parser]] @@ -110,18 +110,18 @@ nominal.abstraction))) (the .public float - (-> Frac Literal) - (|>> (|.cond [(f.= f.positive_infinity)] + (-> Dec Literal) + (|>> (|.cond [(d.= d.positive_infinity)] [(|.new "(1.0/0.0)" [])] - [(f.= f.negative_infinity)] + [(d.= d.negative_infinity)] [(|.new "(-1.0/0.0)" [])] - [(f.= f.not_a_number)] + [(d.= d.not_a_number)] [(|.new "(0.0/0.0)" [])] ... else - [%.frac (text.replaced "+" "")]) + [%.dec (text.replaced "+" "")]) nominal.abstraction)) (the safe diff --git a/stdlib/source/library/lux/meta/compiler/target/php.lux b/stdlib/source/library/lux/meta/compiler/target/php.lux index 2846c8d6f2..75f4fe4b51 100644 --- a/stdlib/source/library/lux/meta/compiler/target/php.lux +++ b/stdlib/source/library/lux/meta/compiler/target/php.lux @@ -19,7 +19,7 @@ [math [number ["n" nat] - ["f" frac]]] + ["d" dec]]] [meta ["[0]" code (.only) ["<[1]>" \\parser]] @@ -167,19 +167,19 @@ nominal.abstraction))) (the .public float - (-> Frac + (-> Dec Literal) - (|>> (pipe.cond [(f.= f.positive_infinity)] + (|>> (pipe.cond [(d.= d.positive_infinity)] [(pipe.new "+INF" [])] - [(f.= f.negative_infinity)] + [(d.= d.negative_infinity)] [(pipe.new "-INF" [])] - [(f.= f.not_a_number)] + [(d.= d.not_a_number)] [(pipe.new "NAN" [])] ... else - [%.frac]) + [%.dec]) nominal.abstraction)) (the safe diff --git a/stdlib/source/library/lux/meta/compiler/target/python.lux b/stdlib/source/library/lux/meta/compiler/target/python.lux index 825d2b8a07..72d69faae3 100644 --- a/stdlib/source/library/lux/meta/compiler/target/python.lux +++ b/stdlib/source/library/lux/meta/compiler/target/python.lux @@ -19,7 +19,7 @@ [math [number ["n" nat] - ["f" frac]]] + ["d" dec]]] [meta ["[0]" code (.only) ["<[1]>" \\parser]] @@ -141,18 +141,18 @@ (format (%.int value) "L"))) (the .public float - (-> Frac Literal) + (-> Dec Literal) (`` (|>> (pipe.cond (,, (with_template [ ] [[] [(pipe.new (format "float(" text.double_quote text.double_quote ")") [])]] - [(f.= f.positive_infinity) "inf"] - [(f.= f.negative_infinity) "-inf"] - [f.not_a_number? "nan"] + [(d.= d.positive_infinity) "inf"] + [(d.= d.negative_infinity) "-inf"] + [d.not_a_number? "nan"] )) ... else - [%.frac]) + [%.dec]) nominal.abstraction))) (the safe diff --git a/stdlib/source/library/lux/meta/compiler/target/r.lux b/stdlib/source/library/lux/meta/compiler/target/r.lux index 464030bdd6..6df9dd46e4 100644 --- a/stdlib/source/library/lux/meta/compiler/target/r.lux +++ b/stdlib/source/library/lux/meta/compiler/target/r.lux @@ -15,7 +15,7 @@ ["[0]" list (.use "[1]#[0]" functor mix)]]] [math [number - ["f" frac]]] + ["d" dec]]] [meta ["[0]" code (.only) ["<[1]>" \\parser]] @@ -126,18 +126,18 @@ (|>> %.int nominal.abstraction)) (the .public float - (-> Frac Expression) - (|>> (pipe.cond [(f.= f.positive_infinity)] + (-> Dec Expression) + (|>> (pipe.cond [(d.= d.positive_infinity)] [(pipe.new "1.0/0.0" [])] - [(f.= f.negative_infinity)] + [(d.= d.negative_infinity)] [(pipe.new "-1.0/0.0" [])] - [(f.= f.not_a_number)] + [(d.= d.not_a_number)] [(pipe.new "0.0/0.0" [])] ... else - [%.frac]) + [%.dec]) ..self_contained)) (the safe diff --git a/stdlib/source/library/lux/meta/compiler/target/ruby.lux b/stdlib/source/library/lux/meta/compiler/target/ruby.lux index 3cb2ea66a5..3e9788d8b1 100644 --- a/stdlib/source/library/lux/meta/compiler/target/ruby.lux +++ b/stdlib/source/library/lux/meta/compiler/target/ruby.lux @@ -19,7 +19,7 @@ [math [number ["n" nat] - ["f" frac]]] + ["d" dec]]] [meta ["[0]" code (.only) ["<[1]>" \\parser]] @@ -195,18 +195,18 @@ ) (the .public float - (-> Frac Literal) - (|>> (pipe.cond [(f.= f.positive_infinity)] + (-> Dec Literal) + (|>> (pipe.cond [(d.= d.positive_infinity)] [(pipe.new "(+1.0/0.0)" [])] - [(f.= f.negative_infinity)] + [(d.= d.negative_infinity)] [(pipe.new "(-1.0/0.0)" [])] - [(f.= f.not_a_number)] + [(d.= d.not_a_number)] [(pipe.new "(+0.0/-0.0)" [])] ... else - [%.frac]) + [%.dec]) nominal.abstraction)) (the .public (array_range from to array) diff --git a/stdlib/source/library/lux/meta/compiler/target/scheme.lux b/stdlib/source/library/lux/meta/compiler/target/scheme.lux index 237981c96e..6a1e4e97d6 100644 --- a/stdlib/source/library/lux/meta/compiler/target/scheme.lux +++ b/stdlib/source/library/lux/meta/compiler/target/scheme.lux @@ -18,7 +18,7 @@ [math [number ["n" nat] - ["f" frac]]] + ["d" dec]]] [meta [macro ["[0]" template]] @@ -118,26 +118,27 @@ (the .public int (-> Int Computation) - (|>> %.int nominal.abstraction)) + (|>> %.int + nominal.abstraction)) (the .public float - (-> Frac Computation) - (|>> (pipe.cond [(f.= f.positive_infinity)] + (-> Dec Computation) + (|>> (pipe.cond [(d.= d.positive_infinity)] [(pipe.new "+inf.0" [])] - [(f.= f.negative_infinity)] + [(d.= d.negative_infinity)] [(pipe.new "-inf.0" [])] - [f.not_a_number?] + [d.not_a_number?] [(pipe.new "+nan.0" [])] ... else - [%.frac]) + [%.dec]) nominal.abstraction)) - (the .public positive_infinity Computation (..float f.positive_infinity)) - (the .public negative_infinity Computation (..float f.negative_infinity)) - (the .public not_a_number Computation (..float f.not_a_number)) + (the .public positive_infinity Computation (..float d.positive_infinity)) + (the .public negative_infinity Computation (..float d.negative_infinity)) + (the .public not_a_number Computation (..float d.not_a_number)) (the safe (-> Text Text) diff --git a/stdlib/source/library/lux/meta/macro/pattern.lux b/stdlib/source/library/lux/meta/macro/pattern.lux index 7f9640b01a..b847d4d8e2 100644 --- a/stdlib/source/library/lux/meta/macro/pattern.lux +++ b/stdlib/source/library/lux/meta/macro/pattern.lux @@ -60,7 +60,7 @@ [as_nat] [as_int] [as_rev] - [as_frac] + [as_dec] [one_expansion] ) @@ -293,7 +293,7 @@ [.#Nat as_nat] [.#Int as_int] [.#Rev as_rev] - [.#Frac as_frac] + [.#Dec as_dec] [.#Text as_text] [.#Symbol name$]) diff --git a/stdlib/source/library/lux/meta/macro/template.lux b/stdlib/source/library/lux/meta/macro/template.lux index fd5d062e85..099e2ecb87 100644 --- a/stdlib/source/library/lux/meta/macro/template.lux +++ b/stdlib/source/library/lux/meta/macro/template.lux @@ -21,7 +21,7 @@ ["[0]" nat (.use "[1]#[0]" decimal)] ["[0]" int (.use "[1]#[0]" decimal)] ["[0]" rev (.use "[1]#[0]" decimal)] - ["[0]" frac (.use "[1]#[0]" decimal)]]] + ["[0]" dec (.use "[1]#[0]" decimal)]]] ["[0]" meta (.only) ["[0]" code (.only) ["<[1]>" \\parser (.only Parser)]]]]] @@ -74,7 +74,7 @@ (<>#each nat#encoded .nat) (<>#each int#encoded .int) (<>#each rev#encoded .rev) - (<>#each frac#encoded .frac) + (<>#each dec#encoded .dec) ))) (the (part module_side?) diff --git a/stdlib/source/library/lux/meta/static.lux b/stdlib/source/library/lux/meta/static.lux index b369d5fa62..072df56b00 100644 --- a/stdlib/source/library/lux/meta/static.lux +++ b/stdlib/source/library/lux/meta/static.lux @@ -31,7 +31,7 @@ [nat .Nat code.nat] [int .Int code.int] [rev .Rev code.rev] - [frac .Frac code.frac] + [dec .Dec code.dec] [text .Text code.text] ) @@ -88,7 +88,7 @@ [random_nat random.nat code.nat] [random_int random.int code.int] [random_rev random.rev code.rev] - [random_frac random.frac code.frac] + [random_dec random.dec code.dec] ) (with_expansions [ (Ex (_ a) diff --git a/stdlib/source/library/lux/meta/type/poly.lux b/stdlib/source/library/lux/meta/type/poly.lux index db8dd652b6..c44700e782 100644 --- a/stdlib/source/library/lux/meta/type/poly.lux +++ b/stdlib/source/library/lux/meta/type/poly.lux @@ -1,6 +1,11 @@ ... This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. ... If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. +... [PolyP—a polytypic programming language extension](https://dl.acm.org/doi/10.1145/263699.263763) +... [Polytypic Programming in Haskell](https://www.researchgate.net/publication/2885193_Polytypic_Programming_in_Haskell) +... [Polytypic Programming](https://www.researchgate.net/publication/2272082_Polytypic_Programming) +... [Polytypic Programming With Ease](https://www.researchgate.net/publication/2854383_Polytypic_Programming_With_Ease) +... [Polytypic Genetic Programming](https://eprints.whiterose.ac.uk/117964/) (.require [library [lux (.except has with) diff --git a/stdlib/source/library/lux/test/property.lux b/stdlib/source/library/lux/test/property.lux index 1e3f8dd2d9..9e51ebba05 100644 --- a/stdlib/source/library/lux/test/property.lux +++ b/stdlib/source/library/lux/test/property.lux @@ -30,7 +30,7 @@ ["[0]" random (.only Random) (.use "[1]#[0]" monad)] [number (.only hex) ["n" nat] - ["f" frac]]] + ["d" dec]]] [meta ["[0]" symbol] ["[0]" code @@ -176,19 +176,19 @@ (set.size (its tally.#actual tally))) coverage (when expected_coverage 0 "N/A" - expected (let [missing_ratio (f./ (n.frac expected) - (n.frac (set.size missing))) + expected (let [missing_ratio (d./ (n.dec expected) + (n.dec (set.size missing))) max_percent +100.0 done_percent (|> +1.0 - (f.- missing_ratio) - (f.* max_percent))] - (if (f.= max_percent done_percent) + (d.- missing_ratio) + (d.* max_percent))] + (if (d.= max_percent done_percent) "100%" (let [raw (|> done_percent - %.frac + %.dec (text.replaced_once "+" ""))] (|> raw - (text.clip 0 (if (f.< +10.0 done_percent) + (text.clip 0 (if (d.< +10.0 done_percent) 4 ... X.XX 5 ... XX.XX )) diff --git a/stdlib/source/library/lux/web/css/value.lux b/stdlib/source/library/lux/web/css/value.lux index edb40b3397..a71486f7ec 100644 --- a/stdlib/source/library/lux/web/css/value.lux +++ b/stdlib/source/library/lux/web/css/value.lux @@ -21,7 +21,7 @@ ["n" nat] ["i" int] ["r" rev] - ["f" frac]]] + ["d" dec]]] [meta ["[0]" code (.only) ["<[1]>" \\parser]] @@ -57,9 +57,9 @@ (template.spliced +))])) (the (%number value) - (Format Frac) - (let [raw (%.frac value)] - (if (f.< +0.0 value) + (Format Dec) + (let [raw (%.dec value)] + (if (d.< +0.0 value) raw (|> raw (text.split_at 1) maybe.trusted product.right)))) @@ -810,7 +810,7 @@ (..apply "steps" (list (%.nat intervals) (..step step)))) (the .public (cubic_bezier p0 p1 p2 p3) - (-> Frac Frac Frac Frac + (-> Dec Dec Dec Dec (Value Timing)) (|> (list p0 p1 p2 p3) (list#each %number) @@ -854,7 +854,7 @@ (with_template [ ] [(the .public ( value) - (-> Frac + (-> Dec (Value Length)) (nominal.abstraction (format (%number value) )))] @@ -1041,7 +1041,7 @@ (,, (template.spliced +))))] - [Nat (<| nominal.representation ..px n.frac) + [Nat (<| nominal.representation ..px n.dec) [[blur "blur"]]] [Nat (<| ..angle ..degree) [[hue_rotate "hue-rotate"]]] @@ -1235,7 +1235,7 @@ (|>> nominal.transmutation)) (the .public number - (-> Frac + (-> Dec (Value Number)) (|>> %number nominal.abstraction)) @@ -1320,19 +1320,19 @@ nominal.abstraction)) (the .public (matrix_2d [a b] [c d] [tx ty]) - (-> [Frac Frac] - [Frac Frac] - [Frac Frac] + (-> [Dec Dec] + [Dec Dec] + [Dec Dec] (Value Transform)) (|> (list a b c d tx ty) (list#each %number) (..apply "matrix"))) (the .public (matrix_3d [a0 b0 c0 d0] [a1 b1 c1 d1] [a2 b2 c2 d2] [a3 b3 c3 d3]) - (-> [Frac Frac Frac Frac] - [Frac Frac Frac Frac] - [Frac Frac Frac Frac] - [Frac Frac Frac Frac] + (-> [Dec Dec Dec Dec] + [Dec Dec Dec Dec] + [Dec Dec Dec Dec] + [Dec Dec Dec Dec] (Value Transform)) (|> (list a0 b0 c0 d0 a1 b1 c1 d1 a2 b2 c2 d2 a3 b3 c3 d3) (list#each %number) @@ -1346,19 +1346,19 @@ (list#each %number) (..apply ))))] - [translate_2d "translate" [Frac Frac] [x y]] - [translate_3d "translate3d" [Frac Frac Frac] [x y z]] - [translate_x "translateX" [Frac] [value]] - [translate_y "translateY" [Frac] [value]] - [translate_z "translateZ" [Frac] [value]] + [translate_2d "translate" [Dec Dec] [x y]] + [translate_3d "translate3d" [Dec Dec Dec] [x y z]] + [translate_x "translateX" [Dec] [value]] + [translate_y "translateY" [Dec] [value]] + [translate_z "translateZ" [Dec] [value]] - [scale_2d "scale" [Frac Frac] [x y]] - [scale_3d "scale3d" [Frac Frac Frac] [x y z]] - [scale_x "scaleX" [Frac] [value]] - [scale_y "scaleY" [Frac] [value]] - [scale_z "scaleZ" [Frac] [value]] + [scale_2d "scale" [Dec Dec] [x y]] + [scale_3d "scale3d" [Dec Dec Dec] [x y z]] + [scale_x "scaleX" [Dec] [value]] + [scale_y "scaleY" [Dec] [value]] + [scale_z "scaleZ" [Dec] [value]] - [perspective "perspective" [Frac] [value]] + [perspective "perspective" [Dec] [value]] ) (with_template [ ] @@ -1380,7 +1380,7 @@ ) (the .public (rotate_3d [x y z angle]) - (-> [Frac Frac Frac Angle] + (-> [Dec Dec Dec Angle] (Value Transform)) (..apply "rotate3d" (list (%number x) (%number y) (%number z) (..angle angle)))) diff --git a/stdlib/source/library/lux/web/html/attribute.lux b/stdlib/source/library/lux/web/html/attribute.lux index 374d3dbae1..c706bba9b0 100644 --- a/stdlib/source/library/lux/web/html/attribute.lux +++ b/stdlib/source/library/lux/web/html/attribute.lux @@ -586,9 +586,9 @@ (with_template [] [(the .public - (Name Frac) + (Name Dec) [#label (template.text []) - #format (|>> %.frac + #format (|>> %.dec {.#Some})])] ... https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meter#high diff --git a/stdlib/source/library/lux/web/html/attribute/source.lux b/stdlib/source/library/lux/web/html/attribute/source.lux index dae434b0d9..ecefcf3199 100644 --- a/stdlib/source/library/lux/web/html/attribute/source.lux +++ b/stdlib/source/library/lux/web/html/attribute/source.lux @@ -25,7 +25,7 @@ (%.format url " " ( parameter) )))] ["w" by_width Nat %.nat] - ["x" by_density Frac %.frac] + ["x" by_density Dec %.dec] ) (the .public source diff --git a/stdlib/source/library/lux/world/db/jdbc/input.lux b/stdlib/source/library/lux/world/db/jdbc/input.lux index 63136dea0b..183690c85e 100644 --- a/stdlib/source/library/lux/world/db/jdbc/input.lux +++ b/stdlib/source/library/lux/world/db/jdbc/input.lux @@ -89,8 +89,8 @@ [int Int java/sql/PreparedStatement::setInt] [long Int java/sql/PreparedStatement::setLong] - [float Frac java/sql/PreparedStatement::setFloat] - [double Frac java/sql/PreparedStatement::setDouble] + [float Dec java/sql/PreparedStatement::setFloat] + [double Dec java/sql/PreparedStatement::setDouble] [string Text java/sql/PreparedStatement::setString] [bytes Binary java/sql/PreparedStatement::setBytes] diff --git a/stdlib/source/library/lux/world/db/jdbc/output.lux b/stdlib/source/library/lux/world/db/jdbc/output.lux index 8b7fd58b1e..96337614af 100644 --- a/stdlib/source/library/lux/world/db/jdbc/output.lux +++ b/stdlib/source/library/lux/world/db/jdbc/output.lux @@ -132,8 +132,8 @@ [int java/sql/ResultSet::getInt Int] [long java/sql/ResultSet::getLong Int] - [float java/sql/ResultSet::getFloat Frac] - [double java/sql/ResultSet::getDouble Frac] + [float java/sql/ResultSet::getFloat Dec] + [double java/sql/ResultSet::getDouble Dec] [string java/sql/ResultSet::getString Text] [bytes java/sql/ResultSet::getBytes Binary] diff --git a/stdlib/source/library/lux/world/environment.lux b/stdlib/source/library/lux/world/environment.lux index 52764763a6..8816a349d1 100644 --- a/stdlib/source/library/lux/world/environment.lux +++ b/stdlib/source/library/lux/world/environment.lux @@ -157,7 +157,7 @@ (-> Exit (IO Nothing)) (when (ffi.global ..NodeJs_Process [process]) {.#Some process} - (NodeJs_Process::exit (i.frac code) process) + (NodeJs_Process::exit (i.dec code) process) {.#None} (..default_exit! code))) diff --git a/stdlib/source/library/lux/world/file.lux b/stdlib/source/library/lux/world/file.lux index f0adfaf2b1..753ef681f5 100644 --- a/stdlib/source/library/lux/world/file.lux +++ b/stdlib/source/library/lux/world/file.lux @@ -34,7 +34,7 @@ [math [number ["i" int] - ["f" frac]]] + ["d" dec]]] [meta [macro ["[0]" template]]]]] @@ -461,7 +461,7 @@ node_fs))] (in (|> stats Stats::size - f.nat)))) + d.nat)))) (the (last_modified path) (do (try.with async.monad) @@ -470,7 +470,7 @@ node_fs))] (in (|> stats Stats::mtimeMs - f.int + d.int duration.of_millis instant.absolute)))) @@ -508,7 +508,7 @@ (the (modify path time_stamp) (with_async write! (Try Any) - (let [when (|> time_stamp instant.relative duration.millis i.frac)] + (let [when (|> time_stamp instant.relative duration.millis i.dec)] (Fs::utimes [path when when (..any_callback write!)] node_fs)))) @@ -608,7 +608,7 @@ (the last_modified (|>> [] os/path::getmtime - (of (try.with io.monad) each (|>> f.int + (of (try.with io.monad) each (|>> d.int (i.* +1,000) duration.of_millis instant.absolute)))) @@ -654,8 +654,8 @@ .ruby (these (ffi.import Time "[1]::[0]" - ("static" at [Frac] Time) - (to_f [] Frac)) + ("static" at [Dec] Time) + (to_f [] Dec)) (ffi.import Stat "[1]::[0]" @@ -749,8 +749,8 @@ [file_size [Stat::size .nat]] [last_modified [Stat::mtime Time::to_f - (f.* +1,000.0) - f.int + (d.* +1,000.0) + d.int duration.of_millis instant.absolute]] [can_execute? [Stat::executable?]] @@ -774,8 +774,8 @@ (let [moment (|> moment instant.relative duration.millis - i.frac - (f./ +1,000.0) + i.dec + (d./ +1,000.0) Time::at)] (RubyFile::utime moment moment path))) diff --git a/stdlib/source/library/lux/world/finance/interest/rate.lux b/stdlib/source/library/lux/world/finance/interest/rate.lux index 6d4cfe6942..d8dec42c79 100644 --- a/stdlib/source/library/lux/world/finance/interest/rate.lux +++ b/stdlib/source/library/lux/world/finance/interest/rate.lux @@ -15,13 +15,13 @@ [math [number ["n" nat] - ["f" frac]]]]] + ["d" dec]]]]] [/// ["[0]" money (.only Money)]]) ... https://en.wikipedia.org/wiki/Interest_rate (every .public Rate - Frac) + Dec) ... https://en.wikipedia.org/wiki/Break-even (the .public break_even @@ -32,16 +32,16 @@ (the .public compound (-> Rate Rate Rate) - f.*) + d.*) (with_template [ ] [(the .public (Predicate Rate) ( ..break_even))] - [f.< loss?] - [f.> gain?] - [f.= break_even?] + [d.< loss?] + [d.> gain?] + [d.= break_even?] ) (the .public monoid @@ -52,12 +52,12 @@ (the .public format (%.Format Rate) - (|>> (f.- ..break_even) + (|>> (d.- ..break_even) %.percentage)) (the .public (rate before after) (All (_ $) (-> (Money $) (Money $) Rate)) - (f./ (n.frac (money.amount before)) - (n.frac (money.amount after)))) + (d./ (n.dec (money.amount before)) + (n.dec (money.amount after)))) diff --git a/stdlib/source/library/lux/world/finance/market/analysis/accumulation_distribution.lux b/stdlib/source/library/lux/world/finance/market/analysis/accumulation_distribution.lux index 64cee9c768..318faaa8eb 100644 --- a/stdlib/source/library/lux/world/finance/market/analysis/accumulation_distribution.lux +++ b/stdlib/source/library/lux/world/finance/market/analysis/accumulation_distribution.lux @@ -8,7 +8,7 @@ [math [number ["n" nat] - ["f" frac]]]]] + ["d" dec]]]]] [//// ["[0]" money] [trade @@ -17,10 +17,10 @@ (the .public (oscillation it) (All (_ $) (-> (Session $) - Frac)) + Dec)) (let [high (money.amount (session.high it)) low (money.amount (session.low it)) close (money.amount (session.close it))] - (f./ (n.frac (n.- low high)) - (n.frac (n.- (n.- close high) + (d./ (n.dec (n.- low high)) + (n.dec (n.- (n.- close high) (n.- low close)))))) diff --git a/stdlib/source/library/lux/world/time/instant.lux b/stdlib/source/library/lux/world/time/instant.lux index 67983ccab4..00cb0c3077 100644 --- a/stdlib/source/library/lux/world/time/instant.lux +++ b/stdlib/source/library/lux/world/time/instant.lux @@ -22,7 +22,7 @@ [math [number ["i" int (.use "[1]#[0]" interval)] - ["f" frac]]] + ["d" dec]]] [meta [type ["[0]" nominal]]]]] @@ -205,12 +205,12 @@ (as Int)) .js (let [date (.js_object_new# (.js_constant# "Date") [])] (|> (.js_object_do# "getTime" date []) - (as Frac) + (as Dec) .f64_int#)) .python (let [time (.python_import# "time")] (|> (.python_object_do# "time" time []) - (as Frac) - (f.* +1,000.0) + (as Dec) + (d.* +1,000.0) .f64_int#)) .lua (|> (.lua_apply# (.lua_constant# "os.time") []) (as Int) @@ -218,8 +218,8 @@ .ruby (let [% (.ruby_constant# "Time") % (.ruby_object_do# "now" % [])] (|> (.ruby_object_do# "to_f" % []) - (as Frac) - (f.* +1,000.0) + (as Dec) + (d.* +1,000.0) .f64_int#)) .php (|> ("php constant" "time") "php apply" diff --git a/stdlib/source/library/lux/world/time/series/average.lux b/stdlib/source/library/lux/world/time/series/average.lux index 4f25d4a69f..ebd340fff8 100644 --- a/stdlib/source/library/lux/world/time/series/average.lux +++ b/stdlib/source/library/lux/world/time/series/average.lux @@ -18,22 +18,22 @@ [math [number ["n" nat] - ["f" frac]]] + ["d" dec]]] [meta [type (.only sharing)]]]] ["[0]" // (.only Series) (.use "[1]#[0]" mix)]) ... https://en.wikipedia.org/wiki/Moving_average#Cumulative_average (the .public cumulative - (-> (Series Frac) - (Series Frac)) + (-> (Series Dec) + (Series Dec)) (revised //.#data (|>> (sequence#mix (function (_ event [[previous_summation previous_period] output]) - (let [summation (f.+ previous_summation event) - average (f./ previous_period summation)] - [[summation (f.+ +1.0 previous_period)] + (let [summation (d.+ previous_summation event) + average (d./ previous_period summation)] + [[summation (d.+ +1.0 previous_period)] (sequence.suffix average output)])) - [[+0.0 +1.0] (is (Sequence Frac) + [[+0.0 +1.0] (is (Sequence Dec) sequence.empty)]) product.right))) @@ -83,33 +83,33 @@ ... https://en.wikipedia.org/wiki/Exponential_smoothing (every .public Factor (-> Nat - Frac)) + Dec)) (the .public (simple_factor additional) Factor - (f./ (n.frac (n.+ 2 additional)) + (d./ (n.dec (n.+ 2 additional)) +2.0)) (the .public (exponential factor) (-> Factor - (Average Frac)) + (Average Dec)) (function (_ it) (let [factor (factor (//.size it)) - ~factor (f.- factor +1.0)] - (//#mix (is (-> Frac Frac - Frac) + ~factor (d.- factor +1.0)] + (//#mix (is (-> Dec Dec + Dec) (function (_ event previous) - (f.+ (f.* ~factor previous) - (f.* factor event)))) + (d.+ (d.* ~factor previous) + (d.* factor event)))) +0.0 it)))) ... https://en.wikipedia.org/wiki/Moving_average#Simple_moving_average (the .public (simple it) - (Average Frac) + (Average Dec) (|> (its //.#data it) - (sequence#mix f.+ +0.0) - (f./ (n.frac (//.size it))))) + (sequence#mix d.+ +0.0) + (d./ (n.dec (//.size it))))) ... https://en.wikipedia.org/wiki/Triangular_number (the (summation_up_to maximum) @@ -121,11 +121,11 @@ ... https://en.wikipedia.org/wiki/Moving_average#Weighted_moving_average (the .public (weighted it) - (Average Frac) + (Average Dec) (|> it (//#mix (function (_ sample [weight summation]) - [(f.+ +1.0 weight) - (|> sample (f.* weight) (f.+ summation))]) + [(d.+ +1.0 weight) + (|> sample (d.* weight) (d.+ summation))]) [+1.0 +0.0]) product.right - (f./ (n.frac (summation_up_to (-- (//.size it))))))) + (d./ (n.dec (summation_up_to (-- (//.size it))))))) diff --git a/stdlib/source/library/lux/world/time/solar.lux b/stdlib/source/library/lux/world/time/solar.lux index 3c04e1f9a3..64b3ec9cf9 100644 --- a/stdlib/source/library/lux/world/time/solar.lux +++ b/stdlib/source/library/lux/world/time/solar.lux @@ -16,7 +16,7 @@ [number ["n" nat] ["i" int] - ["f" frac]]] + ["d" dec]]] [meta [type ["[0]" nominal]]]]] @@ -86,7 +86,7 @@ (ffi.import datetime/utcoffset "[1]::[0]" - (total_seconds [] Frac)) + (total_seconds [] Dec)) (ffi.import datetime/datetime "[1]::[0]" @@ -152,7 +152,7 @@ #zone zone #offset (|> (Date::new []) (Date::getTimezoneOffset []) - f.int + d.int (i.* -60,000) duration.of_millis)]))) .lua (do ! @@ -179,7 +179,7 @@ (datetime/datetime::now [(datetime/datetime::tzinfo tz_now)]) (of ! each (|>> (datetime/datetime::utcoffset []) (datetime/utcoffset::total_seconds []) - f.int + d.int (i.* +1000) duration.of_millis))) utc //.now] diff --git a/stdlib/source/parser/lux/data/binary.lux b/stdlib/source/parser/lux/data/binary.lux index 588dcb93a9..42e6357ff7 100644 --- a/stdlib/source/parser/lux/data/binary.lux +++ b/stdlib/source/parser/lux/data/binary.lux @@ -28,7 +28,7 @@ [math [number ["n" nat] - ["[0]" frac]]] + ["[0]" dec]]] [meta [type (.only sharing)] [macro @@ -132,9 +132,9 @@ [rev Rev] ) -(the .public frac - (Parser Frac) - (//#each frac.of_bits ..bits_64)) +(the .public dec + (Parser Dec) + (//#each dec.of_bits ..bits_64)) (exception.the .public (invalid_tag [range byte]) (Exception [Nat Nat]) @@ -330,7 +330,7 @@ [1 [.#Nat] ..nat] [2 [.#Int] ..int] [3 [.#Rev] ..rev] - [4 [.#Frac] ..frac] + [4 [.#Dec] ..dec] [5 [.#Text] ..text] [6 [.#Symbol] ..symbol] [7 [.#Form] sequence] diff --git a/stdlib/source/parser/lux/data/format/json.lux b/stdlib/source/parser/lux/data/format/json.lux index 8fad578315..3215bf073b 100644 --- a/stdlib/source/parser/lux/data/format/json.lux +++ b/stdlib/source/parser/lux/data/format/json.lux @@ -19,7 +19,7 @@ ["[0]" dictionary (.only Dictionary)]]] [math [number - ["[0]" frac]]] + ["[0]" dec]]] [meta ["[0]" code]]]] [\\library @@ -113,8 +113,8 @@ _ (//.failure (exception.error ..unexpected_value [head])))))] - [boolean? this_boolean /.Boolean bit.equivalence /.#Boolean] - [number? this_number /.Number frac.equivalence /.#Number] + [boolean? this_boolean /.Boolean bit.equivalence /.#Boolean] + [number? this_number /.Number dec.equivalence /.#Number] [string? this_string /.String text.equivalence /.#String] ) diff --git a/stdlib/source/parser/lux/meta/code.lux b/stdlib/source/parser/lux/meta/code.lux index 544b7a9822..bfa3abc600 100644 --- a/stdlib/source/parser/lux/meta/code.lux +++ b/stdlib/source/parser/lux/meta/code.lux @@ -19,7 +19,7 @@ ["[0]" nat] ["[0]" int] ["[0]" rev] - ["[0]" frac]]] + ["[0]" dec]]] [meta ["[0]" location] ["[0]" symbol] @@ -96,7 +96,7 @@ [nat this_nat Nat .#Nat nat.equivalence "nat"] [int this_int Int .#Int int.equivalence "int"] [rev this_rev Rev .#Rev rev.equivalence "rev"] - [frac this_frac Frac .#Frac frac.equivalence "frac"] + [dec this_dec Dec .#Dec dec.equivalence "dec"] [text this_text Text .#Text text.equivalence "text"] [symbol this_symbol Symbol .#Symbol symbol.equivalence "symbol"] ) diff --git a/stdlib/source/parser/lux/meta/compiler/language/lux/analysis.lux b/stdlib/source/parser/lux/meta/compiler/language/lux/analysis.lux index 9b9857c076..c8ab016124 100644 --- a/stdlib/source/parser/lux/meta/compiler/language/lux/analysis.lux +++ b/stdlib/source/parser/lux/meta/compiler/language/lux/analysis.lux @@ -22,7 +22,7 @@ ["[0]" nat] ["[0]" int] ["[0]" rev] - ["[0]" frac]]] + ["[0]" dec]]] [meta ["[0]" symbol] [macro @@ -123,7 +123,7 @@ [nat this_nat /.nat Nat nat.equivalence] [int this_int /.int Int int.equivalence] [rev this_rev /.rev Rev rev.equivalence] - [frac this_frac /.frac Frac frac.equivalence] + [dec this_dec /.dec Dec dec.equivalence] [text this_text /.text Text text.equivalence] [local this_local /.local Nat nat.equivalence] [foreign this_foreign /.foreign Nat nat.equivalence] diff --git a/stdlib/source/parser/lux/meta/compiler/language/lux/synthesis.lux b/stdlib/source/parser/lux/meta/compiler/language/lux/synthesis.lux index 9a2103f70f..61c0222479 100644 --- a/stdlib/source/parser/lux/meta/compiler/language/lux/synthesis.lux +++ b/stdlib/source/parser/lux/meta/compiler/language/lux/synthesis.lux @@ -20,7 +20,7 @@ [number ["n" nat] ["[0]" i64] - ["[0]" frac]]] + ["[0]" dec]]] [meta ["[0]" symbol] [compiler @@ -119,7 +119,7 @@ [bit this_bit /.bit Bit bit.equivalence] [i64 this_i64 /.i64 I64 i64.equivalence] - [f64 this_f64 /.f64 Frac frac.equivalence] + [f64 this_f64 /.f64 Dec dec.equivalence] [text this_text /.text Text text.equivalence] [local this_local /.local Nat n.equivalence] [foreign this_foreign /.foreign Nat n.equivalence] diff --git a/stdlib/source/polytypic/lux/abstract/equivalence.lux b/stdlib/source/polytypic/lux/abstract/equivalence.lux index c1eb42e62f..43bd738f1a 100644 --- a/stdlib/source/polytypic/lux/abstract/equivalence.lux +++ b/stdlib/source/polytypic/lux/abstract/equivalence.lux @@ -27,7 +27,7 @@ ["[0]" nat] ["[0]" int] ["[0]" rev] - ["[0]" frac]]] + ["[0]" dec]]] [meta [type ["[0]" poly (.only polytypic)] @@ -63,7 +63,7 @@ [Nat (` nat.equivalence)] [Int (` int.equivalence)] [Rev (` rev.equivalence)] - [Frac (` frac.equivalence)] + [Dec (` dec.equivalence)] [Text (` text.equivalence)] [duration.Duration (` duration.equivalence)] [instant.Instant (` instant.equivalence)] diff --git a/stdlib/source/polytypic/lux/data/format/json.lux b/stdlib/source/polytypic/lux/data/format/json.lux index 90d8ae8859..f45c9aa74c 100644 --- a/stdlib/source/polytypic/lux/data/format/json.lux +++ b/stdlib/source/polytypic/lux/data/format/json.lux @@ -46,7 +46,7 @@ [Nat (` /.nat)] [Int (` /.int)] [Rev (` /.rev)] - [Frac (` /.frac)] + [Dec (` /.dec)] [Text (` /.text)] [duration.Duration (` /.duration)] [instant.Instant (` /.instant)] diff --git a/stdlib/source/test/lux.lux b/stdlib/source/test/lux.lux index 3cef2bb30c..2dcc353906 100644 --- a/stdlib/source/test/lux.lux +++ b/stdlib/source/test/lux.lux @@ -29,7 +29,6 @@ ["n" nat] ["i" int] ["r" rev] - ["f" frac] ["[0]" i64]]] ["[0]" meta (.use "[1]#[0]" monad) ["[0]" static] @@ -45,6 +44,8 @@ ... TODO: Must have 100% coverage on tests. ["[0]" / ["[1][0]" abstract] + ["[1][0]" algorithm + ["[1]/[0]" size]] ["[1][0]" control] ["[1][0]" data] ["[1][0]" debug] @@ -278,7 +279,7 @@ (and (code#= (code.nat 0) (/.' 0)) (code#= (code.int -1) (/.' -1)) (code#= (code.rev .2) (/.' .2)) - (code#= (code.frac +3.4) (/.' +3.4)) + (code#= (code.dec +3.4) (/.' +3.4)) (code#= (code.text "5") (/.' "5")) (code#= (code.symbol ["" "example_symbol"]) (/.' example_symbol)) @@ -288,11 +289,11 @@ (/.' ..example_symbol)) (code#= (code.form (list (code.nat 6) (code.int +7) (code.rev .8))) (/.' (6 +7 .8))) - (code#= (code.variant (list (code.frac +9.0) + (code#= (code.variant (list (code.dec +9.0) (code.text "9") (code.symbol ["" "i8"]))) (/.' {+9.0 "9" i8})) - (code#= (code.tuple (list (code.frac +9.0) + (code#= (code.tuple (list (code.dec +9.0) (code.text "9") (code.symbol ["" "i8"]))) (/.' [+9.0 "9" i8])) @@ -306,7 +307,7 @@ (and (code#= (code.nat 0) (/.` 0)) (code#= (code.int -1) (/.` -1)) (code#= (code.rev .2) (/.` .2)) - (code#= (code.frac +3.4) (/.` +3.4)) + (code#= (code.dec +3.4) (/.` +3.4)) (code#= (code.text "5") (/.` "5")) (code#= (code.symbol [..current_module "example_symbol"]) (/.` example_symbol)) @@ -316,11 +317,11 @@ (/.` ..example_symbol)) (code#= (code.form (list (code.nat 6) (code.int +7) (code.rev .8))) (/.` (6 +7 .8))) - (code#= (code.variant (list (code.frac +9.0) + (code#= (code.variant (list (code.dec +9.0) (code.text "9") (code.symbol [..current_module "i8"]))) (/.` {+9.0 "9" i8})) - (code#= (code.tuple (list (code.frac +9.0) + (code#= (code.tuple (list (code.dec +9.0) (code.text "9") (code.symbol [..current_module "i8"]))) (/.` [+9.0 "9" i8])) @@ -334,7 +335,7 @@ (and (code#= (code.nat 0) (/.`' 0)) (code#= (code.int -1) (/.`' -1)) (code#= (code.rev .2) (/.`' .2)) - (code#= (code.frac +3.4) (/.`' +3.4)) + (code#= (code.dec +3.4) (/.`' +3.4)) (code#= (code.text "5") (/.`' "5")) (code#= (code.symbol ["" "example_symbol"]) (/.`' example_symbol)) @@ -344,11 +345,11 @@ (/.`' ..example_symbol)) (code#= (code.form (list (code.nat 6) (code.int +7) (code.rev .8))) (/.`' (6 +7 .8))) - (code#= (code.variant (list (code.frac +9.0) + (code#= (code.variant (list (code.dec +9.0) (code.text "9") (code.symbol ["" "i8"]))) (/.`' {+9.0 "9" i8})) - (code#= (code.tuple (list (code.frac +9.0) + (code#= (code.tuple (list (code.dec +9.0) (code.text "9") (code.symbol ["" "i8"]))) (/.`' [+9.0 "9" i8])) @@ -363,7 +364,7 @@ example_int random.int] (all _.and (_.for [/.Code /.Code' - /.#Bit /.#Nat /.#Int /.#Rev /.#Frac /.#Text /.#Symbol /.#Form /.#Variant /.#Tuple] + /.#Bit /.#Nat /.#Int /.#Rev /.#Dec /.#Text /.#Symbol /.#Form /.#Variant /.#Tuple] (all _.and ..for_code/' ..for_code/` @@ -979,8 +980,8 @@ expected_int (of ! each (i.% +1) random.int) expected_rev (random.either (in .5) (in .25)) - expected_frac (random.either (in +0.5) - (in +1.25)) + expected_dec (random.either (in +0.5) + (in +1.25)) expected_text (random.either (in "+0.5") (in "+1.25"))] (all _.and @@ -995,7 +996,7 @@ .5 true .25 true _ false) - (/.when expected_frac + (/.when expected_dec +0.5 true +1.25 true _ false) @@ -1309,6 +1310,7 @@ (list ..test|lux /abstract.test + /algorithm/size.test /control.test /data.test /debug.test diff --git a/stdlib/source/test/lux/abstract/equivalence.lux b/stdlib/source/test/lux/abstract/equivalence.lux index 764b2db72b..2774010c72 100644 --- a/stdlib/source/test/lux/abstract/equivalence.lux +++ b/stdlib/source/test/lux/abstract/equivalence.lux @@ -51,31 +51,31 @@ (.Variant {#Case_0 Bit} {#Case_1 Int} - {#Case_2 Frac})) + {#Case_2 Dec})) (every Recursive (Rec Recursive (.Variant - {#Number Frac} - {#Addition Frac Recursive}))) + {#Number Dec} + {#Addition Dec Recursive}))) (every Record (.Record [#bit Bit #int Int - #frac Frac + #dec Dec #text Text #maybe (Maybe Int) #list (List Int) #variant Variant - #tuple [Int Frac Text] + #tuple [Int Dec Text] #recursive Recursive])) (the random_recursive (Random Recursive) (random.rec (function (_ random_recursive) - (random.or random.safe_frac - (random.and random.safe_frac + (random.or random.safe_dec + (random.and random.safe_dec random_recursive))))) (the random @@ -87,17 +87,17 @@ (all random.and random.bit random_int - random.safe_frac + random.safe_dec (random.unicode size) (random.maybe random_int) (random.list size random_int) (all random.or random.bit random_int - random.safe_frac) + random.safe_dec) (all random.and random_int - random.safe_frac + random.safe_dec (random.unicode size)) random_recursive ))) diff --git a/stdlib/source/test/lux/algorithm/size.lux b/stdlib/source/test/lux/algorithm/size.lux new file mode 100644 index 0000000000..ce316cd271 --- /dev/null +++ b/stdlib/source/test/lux/algorithm/size.lux @@ -0,0 +1,46 @@ +... This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +... If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + +(.require + [library + [lux (.except) + [abstract + [monad (.only do)]] + [data + [collection + ["[0]" list]]] + [math + ["[0]" random (.only Random)] + [number + ["n" nat]]] + [test + ["_" property (.only Test)]]]] + [\\library + ["[0]" /]]) + +(the size + (/.Size List) + (is (/.Size (/.Recursive + (All (_ recursion) + (/.Sum (/.Constant []) + (/.Product /.Variable recursion))))) + (/.recursive + (function (_ it) + (/.sum /.constant + (/.product /.variable + it)))))) + +(the .public test + Test + (do [! random.monad] + [expected (of ! each (n.% 10) random.nat) + sample (random.list expected random.nat)] + (<| (_.covering /._) + (_.for [/.Size]) + (all _.and + (_.coverage [/.constant /.variable + /.sum /.product + /.recursive] + (n.= (list.size sample) + (..size sample))) + )))) diff --git a/stdlib/source/test/lux/control/concatenative.lux b/stdlib/source/test/lux/control/concatenative.lux index c03d7224d4..ecc9ffcf7f 100644 --- a/stdlib/source/test/lux/control/concatenative.lux +++ b/stdlib/source/test/lux/control/concatenative.lux @@ -15,7 +15,7 @@ ["n" nat] ["i" int] ["r" rev] - ["f" frac]]] + ["d" dec]]] [meta [macro ["[0]" template]]] @@ -135,9 +135,9 @@ (!numerical r.= random.rev (|>> (r.= .0) not) [[/.r/+ r.+] [/.r/- r.-] [/.r/* r.*] [/.r// r./] [/.r/% r.%]] [[/.r/= r.=] [/.r/< r.<] [/.r/<= r.<=] [/.r/> r.>] [/.r/>= r.>=]]) - (!numerical f.= random.safe_frac (|>> (f.= +0.0) not) - [[/.f/+ f.+] [/.f/- f.-] [/.f/* f.*] [/.f// f./] [/.f/% f.%]] - [[/.f/= f.=] [/.f/< f.<] [/.f/<= f.<=] [/.f/> f.>] [/.f/>= f.>=]]) + (!numerical d.= random.safe_dec (|>> (d.= +0.0) not) + [[/.f/+ d.+] [/.f/- d.-] [/.f/* d.*] [/.f// d./] [/.f/% d.%]] + [[/.f/= d.=] [/.f/< d.<] [/.f/<= d.<=] [/.f/> d.>] [/.f/>= d.>=]]) )) (the control_flow diff --git a/stdlib/source/test/lux/control/concurrency/incremental.lux b/stdlib/source/test/lux/control/concurrency/incremental.lux index abe708f8c9..4645c0e69e 100644 --- a/stdlib/source/test/lux/control/concurrency/incremental.lux +++ b/stdlib/source/test/lux/control/concurrency/incremental.lux @@ -44,7 +44,7 @@ [expected random.nat .let [dummy (++ expected)] - expected_right random.safe_frac]) + expected_right random.safe_dec]) (all _.and (_.for [/.Var] (all _.and diff --git a/stdlib/source/test/lux/data/binary.lux b/stdlib/source/test/lux/data/binary.lux index 59397d13cd..2d3dee6b8f 100644 --- a/stdlib/source/test/lux/data/binary.lux +++ b/stdlib/source/test/lux/data/binary.lux @@ -41,7 +41,7 @@ ["[0]" i64] ["[0]" int] ["[0]" rev] - ["[0]" frac]]] + ["[0]" dec]]] [meta ["[0]" symbol] ["[0]" type] @@ -124,7 +124,7 @@ random.nat random.int random.rev - random.safe_frac + random.safe_dec ..random_text ..random_symbol random_sequence @@ -238,15 +238,15 @@ [\\parser.instant \\format.instant random.instant instant.equivalence] [\\parser.duration \\format.duration random.duration duration.equivalence])) (do [! random.monad] - [expected random.frac] - (_.coverage [\\parser.frac \\format.frac] + [expected random.dec] + (_.coverage [\\parser.dec \\format.dec] (|> expected - (\\format.value \\format.frac) - (\\parser.value \\parser.frac) + (\\format.value \\format.dec) + (\\parser.value \\parser.dec) (!expect (^.multi {try.#Success actual} - (or (of frac.equivalence = expected actual) - (and (frac.not_a_number? expected) - (frac.not_a_number? actual)))))))) + (or (of dec.equivalence = expected actual) + (and (dec.not_a_number? expected) + (dec.not_a_number? actual)))))))) (do [! random.monad] [expected (of ! each (|>> (i64.and (i64.mask \\parser.size_8)) (n.max 2)) diff --git a/stdlib/source/test/lux/data/color/cmyk.lux b/stdlib/source/test/lux/data/color/cmyk.lux index 259b765768..89fd9e5152 100644 --- a/stdlib/source/test/lux/data/color/cmyk.lux +++ b/stdlib/source/test/lux/data/color/cmyk.lux @@ -14,7 +14,7 @@ [math ["[0]" random (.only Random) (.use "[1]#[0]" functor)] [number - ["f" frac]]] + ["d" dec]]] [test ["_" property (.only Test)]]]] [\\library @@ -26,7 +26,7 @@ (the .public value (Random /.Value) - (random#each /.value random.safe_frac)) + (random#each /.value random.safe_dec)) (the .public random (Random /.CMYK) @@ -48,34 +48,34 @@ expected_rgb rgbT.random expected_cmyk ..random - possible_value random.frac + possible_value random.dec .let [delta +0.000000001]]) (all _.and (_.for [/.Value] (all _.and (_.coverage [/.value?] (and (/.value? expected_value) - (not (/.value? (f.+ delta /.most))) - (not (/.value? (f.- delta /.least))))) + (not (/.value? (d.+ delta /.most))) + (not (/.value? (d.- delta /.least))))) (_.coverage [/.value] (if (/.value? possible_value) (|> possible_value /.value - (f.= possible_value)) - (or (f.= /.least (/.value possible_value)) - (f.= /.most (/.value possible_value))))) + (d.= possible_value)) + (or (d.= /.least (/.value possible_value)) + (d.= /.most (/.value possible_value))))) (_.coverage [/.least] - (and (f.< /.most + (and (d.< /.most /.least) (/.value? /.least) - (/.value? (f.+ delta /.least)) - (not (/.value? (f.- delta /.least))))) + (/.value? (d.+ delta /.least)) + (not (/.value? (d.- delta /.least))))) (_.coverage [/.most] - (and (f.> /.least + (and (d.> /.least /.most) (/.value? /.most) - (/.value? (f.- delta /.most)) - (not (/.value? (f.+ delta /.most))))) + (/.value? (d.- delta /.most)) + (not (/.value? (d.+ delta /.most))))) )) (_.for [/.CMYK /.#cyan /.#magenta /.#yellow /.#key] diff --git a/stdlib/source/test/lux/data/color/hsb.lux b/stdlib/source/test/lux/data/color/hsb.lux index 1c67e22d60..012f3d41e3 100644 --- a/stdlib/source/test/lux/data/color/hsb.lux +++ b/stdlib/source/test/lux/data/color/hsb.lux @@ -14,7 +14,7 @@ [math ["[0]" random (.only Random) (.use "[1]#[0]" monad)] [number - ["f" frac]]] + ["d" dec]]] [test ["_" property (.only Test)]]]] [\\library @@ -26,7 +26,7 @@ (the .public value (Random /.Value) - (random#each /.value random.safe_frac)) + (random#each /.value random.safe_dec)) (the .public random (Random /.HSB) @@ -44,7 +44,7 @@ expected_rgb rgbT.random expected_hsb ..random - possible_value random.frac + possible_value random.dec .let [delta +0.000000001] left ..random @@ -54,27 +54,27 @@ (all _.and (_.coverage [/.value?] (and (/.value? expected_value) - (not (/.value? (f.+ delta /.most))) - (not (/.value? (f.- delta /.least))))) + (not (/.value? (d.+ delta /.most))) + (not (/.value? (d.- delta /.least))))) (_.coverage [/.value] (if (/.value? possible_value) (|> possible_value /.value - (f.= possible_value)) - (or (f.= /.least (/.value possible_value)) - (f.= /.most (/.value possible_value))))) + (d.= possible_value)) + (or (d.= /.least (/.value possible_value)) + (d.= /.most (/.value possible_value))))) (_.coverage [/.least] - (and (f.< /.most + (and (d.< /.most /.least) (/.value? /.least) - (/.value? (f.+ delta /.least)) - (not (/.value? (f.- delta /.least))))) + (/.value? (d.+ delta /.least)) + (not (/.value? (d.- delta /.least))))) (_.coverage [/.most] - (and (f.> /.least + (and (d.> /.least /.most) (/.value? /.most) - (/.value? (f.- delta /.most)) - (not (/.value? (f.+ delta /.most))))) + (/.value? (d.- delta /.most)) + (not (/.value? (d.+ delta /.most))))) )) (_.for [/.HSB] (all _.and diff --git a/stdlib/source/test/lux/data/color/hsl.lux b/stdlib/source/test/lux/data/color/hsl.lux index 87af5c6360..b3d5a31f30 100644 --- a/stdlib/source/test/lux/data/color/hsl.lux +++ b/stdlib/source/test/lux/data/color/hsl.lux @@ -15,7 +15,7 @@ ["[0]" random (.only Random) (.use "[1]#[0]" monad)] [number ["n" nat] - ["f" frac]]] + ["d" dec]]] [test ["_" property (.only Test)]]]] [\\library @@ -29,20 +29,20 @@ (with_template [ ] [(the (Random /.Value) - (let [range (f.nat ( +1.0))] + (let [range (d.nat ( +1.0))] (|> random.nat (random#each (|>> (n.% range) - n.frac + n.dec /.value)))))] - [degree f.as_degree f.of_degree] - [percentage f.as_percentage f.of_percentage] + [degree d.as_degree d.of_degree] + [percentage d.as_percentage d.of_percentage] ) (the .public value (Random /.Value) - (random#each /.value random.safe_frac)) + (random#each /.value random.safe_dec)) (the .public random (Random /.HSL) @@ -63,14 +63,14 @@ expected_rgb rgbT.random expected_hsl ..random - possible_value random.frac + possible_value random.dec mediocre (|> ..random (random.only (|>> (its /.#saturation) ((function (_ it) - (and (f.>= +0.25 it) - (f.<= +0.75 it))))))) - ratio (|> random.safe_frac (random.only (f.>= +0.5))) + (and (d.>= +0.25 it) + (d.<= +0.75 it))))))) + ratio (|> random.safe_dec (random.only (d.>= +0.5))) .let [delta +0.000000001] left ..random @@ -80,27 +80,27 @@ (all _.and (_.coverage [/.value?] (and (/.value? expected_value) - (not (/.value? (f.+ delta /.most))) - (not (/.value? (f.- delta /.least))))) + (not (/.value? (d.+ delta /.most))) + (not (/.value? (d.- delta /.least))))) (_.coverage [/.value] (if (/.value? possible_value) (|> possible_value /.value - (f.= possible_value)) - (or (f.= /.least (/.value possible_value)) - (f.= /.most (/.value possible_value))))) + (d.= possible_value)) + (or (d.= /.least (/.value possible_value)) + (d.= /.most (/.value possible_value))))) (_.coverage [/.least] - (and (f.< /.most + (and (d.< /.most /.least) (/.value? /.least) - (/.value? (f.+ delta /.least)) - (not (/.value? (f.- delta /.least))))) + (/.value? (d.+ delta /.least)) + (not (/.value? (d.- delta /.least))))) (_.coverage [/.most] - (and (f.> /.least + (and (d.> /.least /.most) (/.value? /.most) - (/.value? (f.- delta /.most)) - (not (/.value? (f.+ delta /.most))))) + (/.value? (d.- delta /.most)) + (not (/.value? (d.+ delta /.most))))) )) (_.for [/.HSL /.#hue /.#saturation /.#luminance] @@ -120,19 +120,19 @@ (of rgb.equivalence = expected_rgb))) (_.coverage [/.saturated] - (f.> (its /.#saturation mediocre) + (d.> (its /.#saturation mediocre) (its /.#saturation (/.saturated ratio mediocre)))) (_.coverage [/.un_saturated] - (f.< (its /.#saturation mediocre) + (d.< (its /.#saturation mediocre) (its /.#saturation (/.un_saturated ratio mediocre)))) (_.coverage [/.gray_scale] (let [gray'ed (/.gray_scale mediocre)] - (and (f.= +0.0 + (and (d.= +0.0 (its /.#saturation gray'ed)) (|> (its /.#luminance gray'ed) - (f.- (its /.#luminance mediocre)) - f.abs - (f.<= ..rgb_error_margin))))) + (d.- (its /.#luminance mediocre)) + d.abs + (d.<= ..rgb_error_margin))))) (_.coverage [/.format] (bit#= (of /.equivalence = left right) (text#= (/.format left) (/.format right)))) diff --git a/stdlib/source/test/lux/data/color/rgb.lux b/stdlib/source/test/lux/data/color/rgb.lux index fd203ce75b..4236c006c5 100644 --- a/stdlib/source/test/lux/data/color/rgb.lux +++ b/stdlib/source/test/lux/data/color/rgb.lux @@ -23,7 +23,7 @@ [number ["n" nat] ["i" int] - ["f" frac]]] + ["d" dec]]] [test ["_" property (.only Test)]]]] [\\library @@ -44,28 +44,28 @@ (the scale (-> Nat - Frac) + Dec) (|>> .int - i.frac)) + i.dec)) (the square - (-> Frac - Frac) - (f.pow +2.0)) + (-> Dec + Dec) + (d.pow +2.0)) (the square_root - (-> Frac - Frac) - (f.pow +0.5)) + (-> Dec + Dec) + (d.pow +0.5)) (the (distance/3 from to) (-> /.RGB /.RGB - Frac) + Dec) (square_root - (all f.+ - (|> (scale (/.red to)) (f.- (scale (/.red from))) square) - (|> (scale (/.green to)) (f.- (scale (/.green from))) square) - (|> (scale (/.blue to)) (f.- (scale (/.blue from))) square)))) + (all d.+ + (|> (scale (/.red to)) (d.- (scale (/.red from))) square) + (|> (scale (/.green to)) (d.- (scale (/.green from))) square) + (|> (scale (/.blue to)) (d.- (scale (/.blue from))) square)))) (the .public test Test @@ -79,11 +79,11 @@ expected_blue ..value colorful (random.only (function (_ it) - (and (|> it (distance/3 /.black) (f.>= +100.0)) - (|> it (distance/3 /.white) (f.>= +100.0)))) + (and (|> it (distance/3 /.black) (d.>= +100.0)) + (|> it (distance/3 /.white) (d.>= +100.0)))) ..random) - ratio (random.only (f.>= +0.5) - random.safe_frac) + ratio (random.only (d.>= +0.5) + random.safe_dec) left ..random right ..random]) @@ -140,14 +140,14 @@ (of /.equivalence = /.black (/.complement /.white)))) (_.coverage [/.interpolated] - (and (f.<= (distance/3 /.black colorful) + (and (d.<= (distance/3 /.black colorful) (distance/3 /.black (/.interpolated /.black ratio colorful))) - (f.<= (distance/3 /.white colorful) + (d.<= (distance/3 /.white colorful) (distance/3 /.white (/.interpolated /.white ratio colorful))))) (_.coverage [/.darker /.brighter] - (and (f.<= (distance/3 /.black colorful) + (and (d.<= (distance/3 /.black colorful) (distance/3 /.black (/.darker ratio colorful))) - (f.<= (distance/3 /.white colorful) + (d.<= (distance/3 /.white colorful) (distance/3 /.white (/.brighter ratio colorful))))) (_.coverage [/.format] (bit#= (of /.equivalence = left right) diff --git a/stdlib/source/test/lux/data/color/scheme.lux b/stdlib/source/test/lux/data/color/scheme.lux index 02af1ab5d8..954791bc0b 100644 --- a/stdlib/source/test/lux/data/color/scheme.lux +++ b/stdlib/source/test/lux/data/color/scheme.lux @@ -13,7 +13,7 @@ ["[0]" random (.only Random) (.use "[1]#[0]" functor)] [number ["n" nat] - ["f" frac] + ["d" dec] ["r" rev] ["[0]" int]]] [test @@ -29,16 +29,16 @@ Test (<| (_.covering /._) (do [! random.monad] - [expected_hue (of ! each (|>> f.abs (f.% +0.9) (f.+ +0.05)) - random.safe_frac) + [expected_hue (of ! each (|>> d.abs (d.% +0.9) (d.+ +0.05)) + random.safe_dec) .let [expected_saturation +0.5] variations (of ! each (|>> (n.% 3) (n.+ 2)) random.nat) - .let [max_spread (f./ (|> variations ++ .int int.frac) + .let [max_spread (d./ (|> variations ++ .int int.dec) +1.0) - min_spread (f./ +2.0 max_spread) - spread_space (f.- min_spread max_spread)] - spread (of ! each (|>> f.abs (f.% spread_space) (f.+ min_spread)) - random.safe_frac)]) + min_spread (d./ +2.0 max_spread) + spread_space (d.- min_spread max_spread)] + spread (of ! each (|>> d.abs (d.% spread_space) (d.+ min_spread)) + random.safe_dec)]) (`` (all _.and (,, (with_template [] [(_.coverage [] diff --git a/stdlib/source/test/lux/data/format/json.lux b/stdlib/source/test/lux/data/format/json.lux index 1306adecbb..0e655d225b 100644 --- a/stdlib/source/test/lux/data/format/json.lux +++ b/stdlib/source/test/lux/data/format/json.lux @@ -4,7 +4,7 @@ (.require [library [lux (.except Variant Record - #Bit #Text #Frac) + #Bit #Text #Dec) [abstract [codec (.except)] [monad (.only do)] @@ -36,7 +36,7 @@ ["[0]" nat] ["[0]" int] ["[0]" rev] - ["[0]" frac] + ["[0]" dec] ["[0]" i64]]] ["[0]" meta (.only) ["[0]" code] @@ -66,9 +66,9 @@ _ false)])) -(the safe_frac - (Random Frac) - (random.only (|>> frac.not_a_number? not) random.frac)) +(the safe_dec + (Random Dec) + (random.only (|>> dec.not_a_number? not) random.dec)) (the \\parser Test @@ -105,7 +105,7 @@ (!expect {try.#Failure _}))))))] [\\parser.boolean \\parser.boolean? \\parser.this_boolean random.bit /.#Boolean bit.equivalence] - [\\parser.number \\parser.number? \\parser.this_number ..safe_frac /.#Number frac.equivalence] + [\\parser.number \\parser.number? \\parser.this_number ..safe_dec /.#Number dec.equivalence] [\\parser.string \\parser.string? \\parser.this_string (random.unicode 1) /.#String text.equivalence] )) (do [! random.monad] @@ -153,7 +153,7 @@ (exception.is? \\parser.empty_input error))))) (do [! random.monad] [expected_boolean random.bit - expected_number ..safe_frac + expected_number ..safe_dec expected_string (random.unicode 1) [boolean_field number_field string_field] (|> (random.set text.hash 3 (random.unicode 3)) (of ! each (|>> set.list @@ -175,7 +175,7 @@ [string_field {/.#String expected_string}]))}) (!expect (^.multi {try.#Success [actual_boolean actual_number actual_string]} (and (of bit.equivalence = expected_boolean actual_boolean) - (of frac.equivalence = expected_number actual_number) + (of dec.equivalence = expected_number actual_number) (of text.equivalence = expected_string actual_string))))))) (do [! random.monad] [size (of ! each (nat.% 10) random.nat) @@ -197,25 +197,25 @@ (.Variant {#Bit Bit} {#Text Text} - {#Frac Frac})) + {#Dec Dec})) (every Recursive (Rec Recursive (.Variant - {#Number Frac} - {#Addition Frac Recursive}))) + {#Number Dec} + {#Addition Dec Recursive}))) (every Record (.Record - [#maybe (Maybe Frac) + [#maybe (Maybe Dec) #recursive Recursive])) (the gen_recursive (Random Recursive) (random.rec (function (_ gen_recursive) - (random.or random.safe_frac - (random.and random.safe_frac + (random.or random.safe_dec + (random.and random.safe_dec gen_recursive))))) (the gen_record @@ -223,7 +223,7 @@ (do [! random.monad] [size (of ! each (nat.% 2) random.nat)] (all random.and - (random.maybe random.safe_frac) + (random.maybe random.safe_dec) ..gen_recursive))) (for .old (these) @@ -251,7 +251,7 @@ (all random.or (of ! in []) random.bit - random.safe_frac + random.safe_dec (random.unicode size) (random.sequence size again) (random.dictionary text.hash size (random.unicode size) again) @@ -267,7 +267,7 @@ (syntax (_ []) (do meta.monad [value meta.seed] - (in (list (code.frac (nat.frac value))))))) + (in (list (code.dec (nat.dec value))))))) (the string (syntax (_ []) @@ -343,10 +343,10 @@ (codecT.spec rev.equivalence /.rev random.rev) (codecT.spec rev.equivalence (\\polytypic.codec Rev) random.rev) )) - (_.for [/.frac] + (_.for [/.dec] (all _.and - (codecT.spec frac.equivalence /.frac random.frac) - (codecT.spec frac.equivalence (\\polytypic.codec Frac) random.safe_frac) + (codecT.spec dec.equivalence /.dec random.dec) + (codecT.spec dec.equivalence (\\polytypic.codec Dec) random.safe_dec) )) (_.for [/.text] (all _.and @@ -383,18 +383,18 @@ (codecT.spec equivalence (\\polytypic.codec (type (Dictionary Text Nat))) random) ))) (_.for [/.sum] - (let [equivalence (all equivalence.sum bit.equivalence text.equivalence frac.equivalence) - random (all random.or random.bit (random.unicode 2) random.safe_frac)] + (let [equivalence (all equivalence.sum bit.equivalence text.equivalence dec.equivalence) + random (all random.or random.bit (random.unicode 2) random.safe_dec)] (all _.and - (codecT.spec equivalence (all /.sum /.bit /.text /.frac) random) + (codecT.spec equivalence (all /.sum /.bit /.text /.dec) random) (codecT.spec equivalence (\\polytypic.codec Variant) random) ))) ... (_.for [/.product] - ... (let [equivalence (all equivalence.product bit.equivalence text.equivalence frac.equivalence) - ... random (all random.or random.bit (random.unicode 2) random.safe_frac)] + ... (let [equivalence (all equivalence.product bit.equivalence text.equivalence dec.equivalence) + ... random (all random.or random.bit (random.unicode 2) random.safe_dec)] ... (all _.and - ... (codecT.spec equivalence (all /.product /.bit /.text /.frac) random) - ... (codecT.spec equivalence (\\polytypic.codec (type [Bit Text Frac])) random) + ... (codecT.spec equivalence (all /.product /.bit /.text /.dec) random) + ... (codecT.spec equivalence (\\polytypic.codec (type [Bit Text Dec])) random) ... ))) (_.for [/.codec] (all _.and @@ -428,7 +428,7 @@ (try.else false)))) (do random.monad [keys (random.set text.hash 3 (random.alphabetic 1)) - values (random.set frac.hash 3 random.safe_frac) + values (random.set dec.hash 3 random.safe_dec) .let [expected (list.zipped_2 (set.list keys) (list#each (|>> {/.#Number}) (set.list values))) object (/.object expected)]] @@ -453,7 +453,7 @@ [key (random.alphabetic 1) unknown (random.only (|>> (of text.equivalence = key) not) (random.alphabetic 1)) - expected random.safe_frac] + expected random.safe_dec] (_.coverage [/.has] (<| (try.else false) (do try.monad @@ -484,7 +484,7 @@ (try.else false))))] [/.Boolean /.boolean_field /.#Boolean random.bit bit.equivalence] - [/.Number /.number_field /.#Number random.safe_frac frac.equivalence] + [/.Number /.number_field /.#Number random.safe_dec dec.equivalence] [/.String /.string_field /.#String (random.alphabetic 1) text.equivalence] [/.Array /.array_field /.#Array (random.sequence 3 ..random) (sequence.equivalence /.equivalence)] [/.Object /.object_field /.#Object (random.dictionary text.hash 3 (random.alphabetic 1) ..random) (dictionary.equivalence /.equivalence)] diff --git a/stdlib/source/test/lux/data/text.lux b/stdlib/source/test/lux/data/text.lux index b604169691..1550bd55dc 100644 --- a/stdlib/source/test/lux/data/text.lux +++ b/stdlib/source/test/lux/data/text.lux @@ -45,7 +45,7 @@ ["[0]" nat] ["[0]" int] ["[0]" rev] - ["[0]" frac] + ["[0]" dec] ["[0]" ratio]] [arithmetic ["[0]" modular]]] @@ -106,7 +106,7 @@ (random#in [\\format.nat random.nat]) (random#in [\\format.int random.int]) (random#in [\\format.rev random.rev]) - (random#in [\\format.frac random.frac]) + (random#in [\\format.dec random.dec]) )) (the codec @@ -123,7 +123,7 @@ [\\format.nat nat.decimal random.nat] [\\format.int int.decimal random.int] [\\format.rev rev.decimal random.rev] - [\\format.frac frac.decimal random.frac] + [\\format.dec dec.decimal random.dec] [\\format.ratio ratio.codec random.ratio] [\\format.symbol symbol.absolute ($//symbol.random 5 5)] [\\format.xml xml.codec $//xml.random] @@ -145,10 +145,10 @@ [\\format.rev_10 rev.decimal random.rev] [\\format.rev_16 rev.hex random.rev] - [\\format.frac_2 frac.binary random.frac] - [\\format.frac_8 frac.octal random.frac] - [\\format.frac_10 frac.decimal random.frac] - [\\format.frac_16 frac.hex random.frac] + [\\format.dec_2 dec.binary random.dec] + [\\format.dec_8 dec.octal random.dec] + [\\format.dec_10 dec.decimal random.dec] + [\\format.dec_16 dec.hex random.dec] )) (,, (with_template [ ] [(do [! random.monad] @@ -170,18 +170,18 @@ (,, (with_template [ ] [(do [! random.monad] [it (of ! each (|>> - frac.int - int.frac - (frac./ ( +1.0))) - random.safe_frac)] + dec.int + int.dec + (dec./ ( +1.0))) + random.safe_dec)] (_.coverage [] - (/.contains? (\\format.int (frac.int ( it))) + (/.contains? (\\format.int (dec.int ( it))) ( it))))] - [\\format.degree frac.as_degree] - [\\format.percentage frac.as_percentage] - [\\format.permille frac.as_permille] - [\\format.permyriad frac.as_permyriad] + [\\format.degree dec.as_degree] + [\\format.percentage dec.as_percentage] + [\\format.permille dec.as_permille] + [\\format.permyriad dec.as_permyriad] )) ))) diff --git a/stdlib/source/test/lux/debug.lux b/stdlib/source/test/lux/debug.lux index 772a8904ba..3515ea6846 100644 --- a/stdlib/source/test/lux/debug.lux +++ b/stdlib/source/test/lux/debug.lux @@ -62,7 +62,7 @@ (do random.monad [sample_bit random.bit sample_int random.int - sample_frac random.frac + sample_dec random.dec sample_text (random.upper_cased 10) sample_nat random.nat sample_rev random.rev] @@ -75,7 +75,7 @@ [Nat %.nat sample_nat] [Int %.int sample_int] [Rev %.rev sample_rev] - [Frac %.frac sample_frac] + [Dec %.dec sample_dec] [Text %.text sample_text])) ))))) @@ -84,13 +84,13 @@ (do random.monad [sample_bit random.bit sample_int random.int - sample_frac random.frac] - (in (`` (and (when (/.representation (type [Bit Int Frac]) - [sample_bit sample_int sample_frac]) + sample_dec random.dec] + (in (`` (and (when (/.representation (type [Bit Int Dec]) + [sample_bit sample_int sample_dec]) {try.#Success actual} (text#= (format "[" (%.bit sample_bit) " " (%.int sample_int) - " " (%.frac sample_frac) + " " (%.dec sample_dec) "]") actual) @@ -98,8 +98,8 @@ false) ... TODO: Uncomment after switching from the old (tag+last?) to the new (lefts+right?) representation for variants ... (,, (with_template [ ] - ... [(|> (/.representation (type (Or Bit Int Frac)) - ... (is (Or Bit Int Frac) + ... [(|> (/.representation (type (Or Bit Int Dec)) + ... (is (Or Bit Int Dec) ... ( ))) ... (try#each (text#= (format "(" (%.nat ) ... " " (%.bit ) @@ -108,7 +108,7 @@ ... [0 #0 sample_bit %.bit] ... [1 #0 sample_int %.int] - ... [1 #1 sample_frac %.frac] + ... [1 #1 sample_dec %.dec] ... )) ))))) @@ -164,7 +164,7 @@ [sample_bit random.bit sample_nat random.nat sample_int random.int - sample_frac random.frac + sample_dec random.dec can_represent_simple_types! ..can_represent_simple_types can_represent_structure_types! ..can_represent_structure_types @@ -177,7 +177,7 @@ can_represent_complex_types! can_represent_time_types! - (|> (/.representation .Any sample_frac) + (|> (/.representation .Any sample_dec) (try#each (text#= "[]")) (try.else false)) (|> (/.representation (type (List Nat)) (is (List Nat) (list sample_nat))) @@ -206,7 +206,7 @@ (do random.monad [sample_bit random.bit sample_int random.int - sample_frac random.frac + sample_dec random.dec sample_text (random.upper_cased 10)] (_.coverage [/.inspection] (`` (and (,, (with_template [ ] @@ -214,15 +214,15 @@ [%.bit sample_bit] [%.int sample_int] - [%.frac sample_frac] + [%.dec sample_dec] [%.text sample_text] )) - (text#= (|> (list sample_bit sample_int sample_frac sample_text) + (text#= (|> (list sample_bit sample_int sample_dec sample_text) (is (List Any)) (list#each /.inspection) (text.interposed " ") (text.enclosed ["[" "]"])) - (/.inspection [sample_bit sample_int sample_frac sample_text])) + (/.inspection [sample_bit sample_int sample_dec sample_text])) ))))) (the macro_error diff --git a/stdlib/source/test/lux/ffi.js.lux b/stdlib/source/test/lux/ffi.js.lux index cff86d332a..bf4eda4bed 100644 --- a/stdlib/source/test/lux/ffi.js.lux +++ b/stdlib/source/test/lux/ffi.js.lux @@ -15,7 +15,7 @@ ["[0]" random (.only Random)] [number ["[0]" nat] - ["[0]" frac]]] + ["[0]" dec]]] [test ["_" property (.only Test)]]]] [\\library @@ -55,7 +55,7 @@ Test (do [! random.monad] [boolean random.bit - number (of ! each (|>> (nat.% 100) nat.frac) random.nat) + number (of ! each (|>> (nat.% 100) nat.dec) random.nat) string (random.ascii 5) function (of ! each (function (_ shift) (is (-> Nat Nat) diff --git a/stdlib/source/test/lux/ffi.jvm.lux b/stdlib/source/test/lux/ffi.jvm.lux index 55c107482d..a1f14e0ab5 100644 --- a/stdlib/source/test/lux/ffi.jvm.lux +++ b/stdlib/source/test/lux/ffi.jvm.lux @@ -24,7 +24,7 @@ ["[0]" i64] ["n" nat] ["i" int (.use "[1]#[0]" equivalence)] - ["f" frac (.use "[1]#[0]" equivalence)]]] + ["d" dec (.use "[1]#[0]" equivalence)]]] ["[0]" meta (.only) ["[0]" static] ["[0]" type (.use "[1]#[0]" equivalence)] @@ -72,8 +72,8 @@ [short#= /.Short /.short_to_long Int i#=] [integer#= /.Integer /.int_to_long Int i#=] [long#= /.Long <| Int i#=] - [float#= /.Float /.float_to_double Frac f#=] - [double#= /.Double <| Frac f#=] + [float#= /.Float /.float_to_double Dec d#=] + [double#= /.Double <| Dec d#=] [character#= /.Character /.char_to_long Int i#=] ) @@ -96,8 +96,8 @@ integer (of ! each (|>> /.as_int) random.int) byte (of ! each (|>> /.as_byte) random.int) short (of ! each (|>> /.as_short) random.int) - float (|> random.frac - (random.only (|>> f.not_a_number? not)) + float (|> random.dec + (random.only (|>> d.not_a_number? not)) (of ! each (|>> /.as_float)))] (`` (all _.and (,, (with_template [ <=> ] @@ -160,11 +160,11 @@ short (of ! each (|>> /.as_short) random.int) integer (of ! each (|>> /.as_int) random.int) long (of ! each (|>> /.as_long) random.int) - float (|> random.frac - (random.only (|>> f.not_a_number? not)) + float (|> random.dec + (random.only (|>> d.not_a_number? not)) (of ! each (|>> /.as_float))) - double (|> random.frac - (random.only (|>> f.not_a_number? not)) + double (|> random.dec + (random.only (|>> d.not_a_number? not)) (of ! each (|>> /.as_double))) character (of ! each (|>> /.as_int /.int_to_char) random.int) string (of ! each (|>> /.as_string) @@ -236,9 +236,9 @@ [/.Long /.long long long#= (/.of_long long) /.as_long /.of_long i#=] [/.Float /.float float float#= - (/.of_float float) /.as_float /.of_float f#=] + (/.of_float float) /.as_float /.of_float d#=] [/.Double /.double double double#= - (/.of_double double) /.as_double /.of_double f#=] + (/.of_double double) /.as_double /.of_double d#=] [/.Character /.char character character#= (/.of_char character) /.as_char /.of_char i#=] )) diff --git a/stdlib/source/test/lux/ffi.lua.lux b/stdlib/source/test/lux/ffi.lua.lux index 4c3e4398c4..7eb8188097 100644 --- a/stdlib/source/test/lux/ffi.lua.lux +++ b/stdlib/source/test/lux/ffi.lua.lux @@ -24,7 +24,7 @@ (do [! random.monad] [boolean random.bit integer random.int - float random.frac + float random.dec string (random.lower_cased 1)] (<| (_.covering /._) (`` (all _.and diff --git a/stdlib/source/test/lux/ffi.old.lux b/stdlib/source/test/lux/ffi.old.lux index da0de847c0..de93c0bbac 100644 --- a/stdlib/source/test/lux/ffi.old.lux +++ b/stdlib/source/test/lux/ffi.old.lux @@ -17,7 +17,7 @@ [number ["n" nat] ["i" int] - ["f" frac]]] + ["d" dec]]] [meta ["[0]" type (.use "[1]#[0]" equivalence)] [macro @@ -99,10 +99,10 @@ [long random.int int (of ! each (|>> /.long_to_int) random.int) char (of ! each (|>> /.long_to_int /.int_to_char) random.int) - double (|> random.frac - (random.only (|>> f.not_a_number? not))) - float (|> random.frac - (random.only (|>> f.not_a_number? not)) + double (|> random.dec + (random.only (|>> d.not_a_number? not))) + float (|> random.dec + (random.only (|>> d.not_a_number? not)) (of ! each (|>> /.double_to_float)))] (`` (all _.and (,, (with_template [<=> ] @@ -117,8 +117,8 @@ [i.= long /.long_to_float /.float_to_long] [i.= long /.long_to_double /.double_to_long] - [f.= double /.double_to_float /.float_to_double] - [f.= double /.double_to_int /.int_to_double] + [d.= double /.double_to_float /.float_to_double] + [d.= double /.double_to_int /.int_to_double] )) (,, (with_template [ ] [(_.coverage [] @@ -132,9 +132,9 @@ )) (,, (with_template [ ] [(_.coverage [ ] - (or (|> /.float_to_double (f.= (/.float_to_double ))) + (or (|> /.float_to_double (d.= (/.float_to_double ))) (let [capped (|> )] - (|> capped /.float_to_double (f.= (/.float_to_double capped))))))] + (|> capped /.float_to_double (d.= (/.float_to_double capped))))))] [float /.float_to_int /.int_to_float] )) diff --git a/stdlib/source/test/lux/ffi.php.lux b/stdlib/source/test/lux/ffi.php.lux index 43f10d6c9f..adfe862dcc 100644 --- a/stdlib/source/test/lux/ffi.php.lux +++ b/stdlib/source/test/lux/ffi.php.lux @@ -13,8 +13,7 @@ [math ["[0]" random (.only Random)] [number - ["[0]" nat] - ["[0]" frac]]] + ["[0]" nat]]] [test ["_" property (.only Test)]]]] [\\library diff --git a/stdlib/source/test/lux/ffi.py.lux b/stdlib/source/test/lux/ffi.py.lux index 217dc61db5..7e626b955a 100644 --- a/stdlib/source/test/lux/ffi.py.lux +++ b/stdlib/source/test/lux/ffi.py.lux @@ -29,7 +29,7 @@ (do [! random.monad] [boolean random.bit integer random.int - float random.frac + float random.dec string (random.lower_cased 1)] (<| (_.covering /._) (`` (all _.and diff --git a/stdlib/source/test/lux/ffi.rb.lux b/stdlib/source/test/lux/ffi.rb.lux index 394e60a898..13e29f80c4 100644 --- a/stdlib/source/test/lux/ffi.rb.lux +++ b/stdlib/source/test/lux/ffi.rb.lux @@ -28,7 +28,7 @@ (do [! random.monad] [boolean random.bit integer random.int - float random.frac + float random.dec string (random.lower_cased 1)] (<| (_.covering /._) (`` (all _.and diff --git a/stdlib/source/test/lux/ffi.scm.lux b/stdlib/source/test/lux/ffi.scm.lux index 43f10d6c9f..adfe862dcc 100644 --- a/stdlib/source/test/lux/ffi.scm.lux +++ b/stdlib/source/test/lux/ffi.scm.lux @@ -13,8 +13,7 @@ [math ["[0]" random (.only Random)] [number - ["[0]" nat] - ["[0]" frac]]] + ["[0]" nat]]] [test ["_" property (.only Test)]]]] [\\library diff --git a/stdlib/source/test/lux/ffi/export.jvm.lux b/stdlib/source/test/lux/ffi/export.jvm.lux index d019c6348c..06cce37f3a 100644 --- a/stdlib/source/test/lux/ffi/export.jvm.lux +++ b/stdlib/source/test/lux/ffi/export.jvm.lux @@ -16,7 +16,7 @@ [number (.only hex) ["[0]" i64] ["[0]" int (.use "[1]#[0]" equivalence)] - ["[0]" frac (.use "[1]#[0]" equivalence)]]] + ["[0]" dec (.use "[1]#[0]" equivalence)]]] ["[0]" meta (.only) ["[0]" static] ["[0]" code] @@ -34,8 +34,8 @@ (the expected_int (//.as_int (static.random_int))) (the expected_long (//.as_long (static.random_int))) (the expected_char (//.as_char (static.random_int))) -(the expected_float (//.as_float (static.random_frac))) -(the expected_double (//.as_double (static.random_frac))) +(the expected_float (//.as_float (static.random_dec))) +(the expected_double (//.as_double (static.random_dec))) (the expected_string (//.as_string (static.random code.text (random.lower_cased 2)))) (`` (`` (/.export Primitives @@ -65,8 +65,8 @@ [int int.+] [long int.+] [char int.+] - [float frac.+] - [double frac.+] + [float dec.+] + [double dec.+] )) ))) @@ -119,11 +119,11 @@ (random#each (|>> (i64.and (hex "F")) .int) random.nat)) -(the tiny_frac - (Random Frac) +(the tiny_dec + (Random Dec) (random#each (|>> (i64.and (hex "FFFF")) .int - int.frac) + int.dec) random.nat)) (`` (`` (the .public test @@ -140,8 +140,8 @@ [int //.as_int ..tiny_int] [long //.as_long ..tiny_int] [char //.as_char ..tiny_int] - [float //.as_float ..tiny_frac] - [double //.as_double ..tiny_frac] + [float //.as_float ..tiny_dec] + [double //.as_double ..tiny_dec] [string //.as_string (random.lower_cased 1)] ))] (all _.and @@ -152,8 +152,8 @@ (int#= (//.of_int ..expected_int) (//.of_int (Primitives::actual_int))) (int#= (//.of_long ..expected_long) (//.of_long (Primitives::actual_long))) (int#= (//.of_char ..expected_char) (//.of_char (Primitives::actual_char))) - (frac#= (//.of_float ..expected_float) (//.of_float (Primitives::actual_float))) - (frac#= (//.of_double ..expected_double) (//.of_double (Primitives::actual_double))) + (dec#= (//.of_float ..expected_float) (//.of_float (Primitives::actual_float))) + (dec#= (//.of_double ..expected_double) (//.of_double (Primitives::actual_double))) (,, (with_template [<=> <+> ] [(with_expansions [ (template.symbol ["left_" ]) @@ -169,8 +169,8 @@ [int#= int.+ int] [int#= int.+ long] [int#= int.+ char] - [frac#= frac.+ float] - [frac#= frac.+ double] + [dec#= dec.+ float] + [dec#= dec.+ double] )) (text#= (//.of_string ..expected_string) (//.of_string (Objects::actual_string))) diff --git a/stdlib/source/test/lux/math.lux b/stdlib/source/test/lux/math.lux index d07abaaa22..f97dcff5c1 100644 --- a/stdlib/source/test/lux/math.lux +++ b/stdlib/source/test/lux/math.lux @@ -14,7 +14,7 @@ ["n" nat] ["i" int] ["r" rev] - ["f" frac] + ["d" dec] ["[0]" ratio (.only Ratio)] ["[0]" complex (.only Complex)]]] [meta @@ -62,8 +62,8 @@ parameterR (random.only (|>> (r.= .0) not) random.rev) subjectR random.rev - parameterF (random.only (|>> (f.= +0.0) not) random.safe_frac) - subjectF random.safe_frac + parameterF (random.only (|>> (d.= +0.0) not) random.safe_dec) + subjectF random.safe_dec parameter/ (random.only (|>> (ratio.= ratio/0) not) random.ratio) subject/ random.ratio @@ -83,31 +83,31 @@ [/.+ [[n.= n.+ parameterN subjectN] [i.= i.+ parameterI subjectI] [r.= r.+ parameterR subjectR] - [f.= f.+ parameterF subjectF] + [d.= d.+ parameterF subjectF] [ratio.= ratio.+ parameter/ subject/] [complex.= complex.+ parameterC subjectC]]] [/.- [[n.= n.- parameterN subjectN] [i.= i.- parameterI subjectI] [r.= r.- parameterR subjectR] - [f.= f.- parameterF subjectF] + [d.= d.- parameterF subjectF] [ratio.= ratio.- parameter/ subject/] [complex.= complex.- parameterC subjectC]]] [/.* [[n.= n.* parameterN subjectN] [i.= i.* parameterI subjectI] [r.= r.* parameterR subjectR] - [f.= f.* parameterF subjectF] + [d.= d.* parameterF subjectF] [ratio.= ratio.* parameter/ subject/] [complex.= complex.* parameterC subjectC]]] [/./ [[n.= n./ parameterN subjectN] [i.= i./ parameterI subjectI] [r.= r./ parameterR subjectR] - [f.= f./ parameterF subjectF] + [d.= d./ parameterF subjectF] [ratio.= ratio./ parameter/ subject/] [complex.= complex./ parameterC subjectC]]] [/.% [[n.= n.% parameterN subjectN] [i.= i.% parameterI subjectI] [r.= r.% parameterR subjectR] - [f.= f.% parameterF subjectF] + [d.= d.% parameterF subjectF] [ratio.= ratio.% parameter/ subject/] [complex.= complex.% parameterC subjectC]]] )) @@ -123,28 +123,28 @@ [/.= [[n.= parameterN subjectN] [i.= parameterI subjectI] [r.= parameterR subjectR] - [f.= parameterF subjectF] + [d.= parameterF subjectF] [ratio.= parameter/ subject/] [complex.= parameterC subjectC]]] [/.< [[n.< parameterN subjectN] [i.< parameterI subjectI] [r.< parameterR subjectR] - [f.< parameterF subjectF] + [d.< parameterF subjectF] [ratio.< parameter/ subject/]]] [/.<= [[n.<= parameterN subjectN] [i.<= parameterI subjectI] [r.<= parameterR subjectR] - [f.<= parameterF subjectF] + [d.<= parameterF subjectF] [ratio.<= parameter/ subject/]]] [/.> [[n.> parameterN subjectN] [i.> parameterI subjectI] [r.> parameterR subjectR] - [f.> parameterF subjectF] + [d.> parameterF subjectF] [ratio.> parameter/ subject/]]] [/.>= [[n.>= parameterN subjectN] [i.>= parameterI subjectI] [r.>= parameterR subjectR] - [f.>= parameterF subjectF] + [d.>= parameterF subjectF] [ratio.>= parameter/ subject/]]] )) diff --git a/stdlib/source/test/lux/math/arithmetic/infix.lux b/stdlib/source/test/lux/math/arithmetic/infix.lux index 5adc6b2bc2..acffbb372d 100644 --- a/stdlib/source/test/lux/math/arithmetic/infix.lux +++ b/stdlib/source/test/lux/math/arithmetic/infix.lux @@ -12,7 +12,7 @@ ["[0]" random] [number ["n" nat] - ["f" frac]] + ["d" dec]] [geometry ["[0]" circle]]] [test @@ -27,7 +27,7 @@ [subject random.nat parameter random.nat extra random.nat - angle random.safe_frac + angle random.safe_dec factor random.nat] (_.coverage [/.infix] (let [constant_values! @@ -35,7 +35,7 @@ (/.infix subject)) unary_functions! - (f.= (circle.sin angle) + (d.= (circle.sin angle) (/.infix [circle.sin angle])) binary_functions! diff --git a/stdlib/source/test/lux/math/geometry/circle.lux b/stdlib/source/test/lux/math/geometry/circle.lux index 8048af01f1..0261e8f6db 100644 --- a/stdlib/source/test/lux/math/geometry/circle.lux +++ b/stdlib/source/test/lux/math/geometry/circle.lux @@ -10,7 +10,7 @@ [math ["[0]" random (.only Random)] [number - ["f" frac]]] + ["d" dec]]] [test ["_" property (.only Test)]]]] [\\library @@ -20,17 +20,17 @@ +0.0000001) (the (symmetry forward backward angle) - (-> (-> /.Angle Frac) (-> Frac /.Angle) /.Angle Bit) + (-> (-> /.Angle Dec) (-> Dec /.Angle) /.Angle Bit) (let [normal (|> angle forward backward)] - (|> normal forward backward (f.approximately? ..margin_of_error normal)))) + (|> normal forward backward (d.approximately? ..margin_of_error normal)))) (the .public test Test (<| (_.covering /._) (all _.and (do [! random.monad] - [.let [~= (f.approximately? ..margin_of_error)] - angle (|> random.safe_frac (of ! each (f.* /.tau)))] + [.let [~= (d.approximately? ..margin_of_error)] + angle (|> random.safe_dec (of ! each (d.* /.tau)))] (all _.and (_.coverage [/.sin /.asin] (..symmetry /.sin /.asin angle)) @@ -41,40 +41,40 @@ (_.coverage [/.tau] (and (and (~= +0.0 (/.sin /.tau)) (~= +1.0 (/.cos /.tau))) - (and (~= +0.0 (/.sin (f./ +2.0 /.tau))) - (~= -1.0 (/.cos (f./ +2.0 /.tau)))) - (and (~= +1.0 (/.sin (f./ +4.0 /.tau))) - (~= +0.0 (/.cos (f./ +4.0 /.tau)))) - (and (~= -1.0 (/.sin (f.* +3.0 (f./ +4.0 /.tau)))) - (~= +0.0 (/.cos (f.* +3.0 (f./ +4.0 /.tau))))) - (let [x2+y2 (f.+ (f.pow +2.0 (/.sin angle)) - (f.pow +2.0 (/.cos angle)))] + (and (~= +0.0 (/.sin (d./ +2.0 /.tau))) + (~= -1.0 (/.cos (d./ +2.0 /.tau)))) + (and (~= +1.0 (/.sin (d./ +4.0 /.tau))) + (~= +0.0 (/.cos (d./ +4.0 /.tau)))) + (and (~= -1.0 (/.sin (d.* +3.0 (d./ +4.0 /.tau)))) + (~= +0.0 (/.cos (d.* +3.0 (d./ +4.0 /.tau))))) + (let [x2+y2 (d.+ (d.pow +2.0 (/.sin angle)) + (d.pow +2.0 (/.cos angle)))] (~= +1.0 x2+y2)))) (_.coverage [/.pi] - (~= (f./ +2.0 /.tau) + (~= (d./ +2.0 /.tau) /.pi)) )) (do [! random.monad] - [x (of ! each (|>> (f.* +10.0) f.abs) random.safe_frac) - y (of ! each (|>> (f.* +10.0) f.abs) random.safe_frac)] + [x (of ! each (|>> (d.* +10.0) d.abs) random.safe_dec) + y (of ! each (|>> (d.* +10.0) d.abs) random.safe_dec)] (_.coverage [/.hypotenuse] (let [h (/.hypotenuse x y)] - (and (f.>= x h) - (f.>= y h))))) + (and (d.>= x h) + (d.>= y h))))) (do [! random.monad] - [.let [~= (f.approximately? ..margin_of_error) - tau/4 (f./ +4.0 /.tau)] - x (of ! each (f.* tau/4) random.safe_frac) - y (of ! each (f.* tau/4) random.safe_frac)] + [.let [~= (d.approximately? ..margin_of_error) + tau/4 (d./ +4.0 /.tau)] + x (of ! each (d.* tau/4) random.safe_dec) + y (of ! each (d.* tau/4) random.safe_dec)] (_.coverage [/.atan_2] (let [expected (/.atan_2 x y) - actual (if (f.> +0.0 x) - (/.atan (f./ x y)) - (if (f.< +0.0 y) - (f.- /.pi (/.atan (f./ x y))) - (f.+ /.pi (/.atan (f./ x y)))))] + actual (if (d.> +0.0 x) + (/.atan (d./ x y)) + (if (d.< +0.0 y) + (d.- /.pi (/.atan (d./ x y))) + (d.+ /.pi (/.atan (d./ x y)))))] (and (~= expected actual) - (~= tau/4 (/.atan_2 +0.0 (f.abs y))) - (~= (f.opposite tau/4) (/.atan_2 +0.0 (f.opposite (f.abs y)))) - (f.not_a_number? (/.atan_2 +0.0 +0.0)))))) + (~= tau/4 (/.atan_2 +0.0 (d.abs y))) + (~= (d.opposite tau/4) (/.atan_2 +0.0 (d.opposite (d.abs y)))) + (d.not_a_number? (/.atan_2 +0.0 +0.0)))))) ))) diff --git a/stdlib/source/test/lux/math/geometry/hyperbola.lux b/stdlib/source/test/lux/math/geometry/hyperbola.lux index e8de2b1f8d..bc17e45e1a 100644 --- a/stdlib/source/test/lux/math/geometry/hyperbola.lux +++ b/stdlib/source/test/lux/math/geometry/hyperbola.lux @@ -9,7 +9,7 @@ [math ["[0]" random] [number - ["f" frac]] + ["d" dec]] [geometry ["[0]" circle]]] [meta @@ -27,24 +27,24 @@ Test (<| (_.covering /._) (do [! random.monad] - [.let [~= (f.approximately? ..margin_of_error)] - angle (of ! each (f.* circle.tau) random.safe_frac) - sample (of ! each f.abs random.safe_frac) - big (of ! each (f.* +1,000,000,000.00) random.safe_frac)] + [.let [~= (d.approximately? ..margin_of_error)] + angle (of ! each (d.* circle.tau) random.safe_dec) + sample (of ! each d.abs random.safe_dec) + big (of ! each (d.* +1,000,000,000.00) random.safe_dec)] (template.let [(odd! ) [(_.coverage [] - (~= (f.opposite ( angle)) - ( (f.opposite angle))))] + (~= (d.opposite ( angle)) + ( (d.opposite angle))))] (even! ) [(_.coverage [] (~= ( angle) - ( (f.opposite angle))))] + ( (d.opposite angle))))] (inverse! ) [(_.coverage [ ] (~= ( ) - ( (f./ +1.0))))]] + ( (d./ +1.0))))]] (all _.and (odd! /.sine) (even! /.co_sine) diff --git a/stdlib/source/test/lux/math/number.lux b/stdlib/source/test/lux/math/number.lux index 27a68c1ed5..6a2c8d401f 100644 --- a/stdlib/source/test/lux/math/number.lux +++ b/stdlib/source/test/lux/math/number.lux @@ -22,7 +22,7 @@ ["n" nat] ["i" int] ["r" rev] - ["f" frac]]] + ["d" dec]]] ["[0]" / ["[1][0]" i8] ["[1][0]" i16] @@ -31,7 +31,7 @@ ["[1][0]" nat] ["[1][0]" int] ["[1][0]" rev] - ["[1][0]" frac] + ["[1][0]" dec] ["[1][0]" ratio] ["[1][0]" complex]]) @@ -54,8 +54,8 @@ [ (static.random_nat) (static.random_int) (static.random_rev) - (static.random_frac) - (static.random code.frac random.safe_frac)]) + (static.random_dec) + (static.random code.dec random.safe_dec)]) (`` (all _.and (,, (with_template [ ] [(_.coverage [ ] @@ -87,7 +87,7 @@ [n.= ] [i.= ] [r.= ] - [f.= ] + [d.= ] )) (same? ))))] @@ -108,30 +108,30 @@ (and (,, (with_template [] [(and (with_expansions [ (static.literal (|>> (of encoded) code.text) - )] + )] (when (of decoded ) {try.#Success actual} - (and (f.approximately? +0.0000000000001 (/.dec ) actual) - (f.approximately? +0.0000000000001 (/.dec ) )) + (and (d.approximately? +0.0000000000001 (/.dec ) actual) + (d.approximately? +0.0000000000001 (/.dec ) )) {try.#Failure error} false)) (with_expansions [ (static.literal (|>> (of encoded) ..with_commas code.text) - )] + )] (when (of decoded (..without_commas )) {try.#Success actual} - (and (f.approximately? +0.0000000000001 (/.dec ) actual) - (f.approximately? +0.0000000000001 (/.dec ) )) + (and (d.approximately? +0.0000000000001 (/.dec ) actual) + (d.approximately? +0.0000000000001 (/.dec ) )) {try.#Failure error} false)))] - [f.degree] - [f.percentage] - [f.permille] - [f.permyriad] + [d.degree] + [d.percentage] + [d.permille] + [d.permyriad] )))) /i8.test @@ -141,7 +141,7 @@ /nat.test /int.test /rev.test - /frac.test + /dec.test /ratio.test /complex.test )))) diff --git a/stdlib/source/test/lux/math/number/complex.lux b/stdlib/source/test/lux/math/number/complex.lux index 0c865bf66d..1ef6682365 100644 --- a/stdlib/source/test/lux/math/number/complex.lux +++ b/stdlib/source/test/lux/math/number/complex.lux @@ -24,20 +24,20 @@ [// ["n" nat] ["i" int] - ["f" frac]]]]) + ["d" dec]]]]) ... This margin of error is necessary because floating-point arithmetic is not exact. (the margin_of_error +0.000000001) (the dimension - (Random Frac) + (Random Dec) (let [side_range +1,000 full_range (i.* side_range side_range)] (|> random.int (random#each (|>> (i.% full_range) - i.frac - (f./ (i.frac side_range))))))) + i.dec + (d./ (i.dec side_range))))))) (the .public random (Random /.Complex) @@ -49,10 +49,10 @@ (the angle (Random /.Complex) (of random.monad each - (|>> f.abs - (f.* circle.tau) + (|>> d.abs + (d.* circle.tau) (/.polar +1.0)) - random.safe_frac)) + random.safe_dec)) (the construction Test @@ -62,18 +62,18 @@ (all _.and (_.coverage [/.complex] (and (let [r+i (/.complex real imaginary)] - (and (f.= real (its /.#real r+i)) - (f.= imaginary (its /.#imaginary r+i)))) + (and (d.= real (its /.#real r+i)) + (d.= imaginary (its /.#imaginary r+i)))) (let [r+i (/.complex real)] - (and (f.= real (its /.#real r+i)) - (f.= +0.0 (its /.#imaginary r+i)))))) + (and (d.= real (its /.#real r+i)) + (d.= +0.0 (its /.#imaginary r+i)))))) (_.coverage [/.approximately?] (/.approximately? ..margin_of_error (/.complex real imaginary) (/.complex real imaginary))) (_.coverage [/.not_a_number?] - (and (/.not_a_number? (/.complex f.not_a_number imaginary)) - (/.not_a_number? (/.complex real f.not_a_number)))) + (and (/.not_a_number? (/.complex d.not_a_number imaginary)) + (/.not_a_number? (/.complex real d.not_a_number)))) ))) (the constant @@ -107,18 +107,18 @@ (_.coverage [/.abs] (let [normal! (let [r+i (/.complex real imaginary)] - (and (f.>= (f.abs real) (/.abs r+i)) - (f.>= (f.abs imaginary) (/.abs r+i)))) + (and (d.>= (d.abs real) (/.abs r+i)) + (d.>= (d.abs imaginary) (/.abs r+i)))) not_a_number! - (and (f.not_a_number? (/.abs (/.complex f.not_a_number imaginary))) - (f.not_a_number? (/.abs (/.complex real f.not_a_number)))) + (and (d.not_a_number? (/.abs (/.complex d.not_a_number imaginary))) + (d.not_a_number? (/.abs (/.complex real d.not_a_number)))) infinity! - (and (f.= f.positive_infinity (/.abs (/.complex f.positive_infinity imaginary))) - (f.= f.positive_infinity (/.abs (/.complex real f.positive_infinity))) - (f.= f.positive_infinity (/.abs (/.complex f.negative_infinity imaginary))) - (f.= f.positive_infinity (/.abs (/.complex real f.negative_infinity))))] + (and (d.= d.positive_infinity (/.abs (/.complex d.positive_infinity imaginary))) + (d.= d.positive_infinity (/.abs (/.complex real d.positive_infinity))) + (d.= d.positive_infinity (/.abs (/.complex d.negative_infinity imaginary))) + (d.= d.positive_infinity (/.abs (/.complex real d.negative_infinity))))] (and normal! not_a_number! infinity!))) @@ -142,17 +142,17 @@ (_.coverage [/.+] (let [z (/.+ y x)] (and (/.= z - (/.complex (f.+ (its /.#real y) + (/.complex (d.+ (its /.#real y) (its /.#real x)) - (f.+ (its /.#imaginary y) + (d.+ (its /.#imaginary y) (its /.#imaginary x))))))) (_.coverage [/.-] (let [normal! (let [z (/.- y x)] (and (/.= z - (/.complex (f.- (its /.#real y) + (/.complex (d.- (its /.#real y) (its /.#real x)) - (f.- (its /.#imaginary y) + (d.- (its /.#imaginary y) (its /.#imaginary x)))))) inverse! @@ -168,8 +168,8 @@ (let [rem (/.% y x) quotient (|> x (/.- rem) (/./ y)) floored (|> quotient - (revised /.#real f.floor) - (revised /.#imaginary f.floor))] + (revised /.#real d.floor) + (revised /.#imaginary d.floor))] (/.approximately? +0.000000000001 x (|> quotient (/.* y) (/.+ rem))))) @@ -182,9 +182,9 @@ (all _.and (_.coverage [/.conjugate] (let [cx (/.conjugate x)] - (and (f.= (its /.#real x) + (and (d.= (its /.#real x) (its /.#real cx)) - (f.= (f.opposite (its /.#imaginary x)) + (d.= (d.opposite (its /.#imaginary x)) (its /.#imaginary cx))))) (_.coverage [/.reciprocal] (let [reciprocal! @@ -197,9 +197,9 @@ (_.coverage [/.signum] ... Absolute value of signum is always root_2(2), 1 or 0. (let [signum_abs (|> x /.signum /.abs)] - (or (f.= +0.0 signum_abs) - (f.= +1.0 signum_abs) - (f.= (f.pow +0.5 +2.0) signum_abs)))) + (or (d.= +0.0 signum_abs) + (d.= +1.0 signum_abs) + (d.= (d.pow +0.5 +2.0) signum_abs)))) (_.coverage [/.opposite] (let [own_inverse! (let [there (/.opposite x) @@ -208,7 +208,7 @@ (/.= back_again x))) absolute! - (f.= (/.abs x) + (d.= (/.abs x) (/.abs (/.opposite x)))] (and own_inverse! absolute!))) @@ -285,7 +285,7 @@ (_.coverage [/.roots] (|> sample (/.roots degree) - (list#each (/.pow' (|> degree .int i.frac))) + (list#each (/.pow' (|> degree .int i.dec))) (list.every? (/.approximately? ..margin_of_error sample)))))) (the polar @@ -294,10 +294,10 @@ [it ..random] (all _.and (_.coverage [/.magnitude] - (f.>= +0.0 (/.magnitude it))) + (d.>= +0.0 (/.magnitude it))) (_.coverage [/.phase] - (and (f.>= (f.* -1.0 circle.pi) (/.phase it)) - (f.<= circle.pi (/.phase it)))) + (and (d.>= (d.* -1.0 circle.pi) (/.phase it)) + (d.<= circle.pi (/.phase it)))) (_.coverage [/.polar] (/.approximately? ..margin_of_error it diff --git a/stdlib/source/test/lux/math/number/frac.lux b/stdlib/source/test/lux/math/number/dec.lux similarity index 90% rename from stdlib/source/test/lux/math/number/frac.lux rename to stdlib/source/test/lux/math/number/dec.lux index 89adee8a2a..f7d750431c 100644 --- a/stdlib/source/test/lux/math/number/frac.lux +++ b/stdlib/source/test/lux/math/number/dec.lux @@ -37,13 +37,13 @@ ["[0]" i64]]]]) (the random - (Random Frac) - (of random.monad each (|>> (i.% +1,000,000) i.frac) random.int)) + (Random Dec) + (of random.monad each (|>> (i.% +1,000,000) i.dec) random.int)) (the constant Test (do random.monad - [sample random.safe_frac] + [sample random.safe_dec] (all _.and (_.coverage [/.biggest] (/.<= /.biggest sample)) @@ -91,27 +91,27 @@ (do [! random.monad] [expected (of ! each (n.% 1,000,000) random.nat)] (_.coverage [/.nat] - (|> expected n.frac /.nat (n.= expected)))) + (|> expected n.dec /.nat (n.= expected)))) (do [! random.monad] [expected (of ! each (i.% +1,000,000) random.int)] (_.coverage [/.int] - (|> expected i.frac /.int (i.= expected)))) + (|> expected i.dec /.int (i.= expected)))) (do [! random.monad] [expected (of ! each (|>> (i64.left_shifted 52) .rev) random.nat)] (_.coverage [/.rev] - (|> expected r.frac /.rev (r.= expected)))) + (|> expected r.dec /.rev (r.= expected)))) )) (the signature Test (`` (all _.and (_.for [/.equivalence /.=] - (equivalenceT.spec /.equivalence random.safe_frac)) + (equivalenceT.spec /.equivalence random.safe_dec)) (_.for [/.hash] - (hashT.spec /.hash random.frac)) + (hashT.spec /.hash random.dec)) (_.for [/.order /.<] - (orderT.spec /.order random.safe_frac)) + (orderT.spec /.order random.safe_dec)) (,, (with_template [ ] [(_.for [ ] (monoidT.spec /.equivalence ..random))] @@ -124,13 +124,13 @@ )) (,, (with_template [] [(_.for [] - (codecT.spec /.equivalence random.safe_frac))] + (codecT.spec /.equivalence random.safe_dec))] [/.binary] [/.octal] [/.decimal] [/.hex] )) (,, (with_template [] [(_.for [] - (codecT.spec (/.approximately? +0.0000000000001) random.safe_frac))] + (codecT.spec (/.approximately? +0.0000000000001) random.safe_dec))] [/.degree] [/.percentage] [/.permille] [/.permyriad] )) @@ -143,7 +143,7 @@ (_.coverage [/.base_16] (same? /.hex /.base_16)) (_.for [/.arithmetic] - (arithmeticT.spec /.equivalence /.arithmetic random.safe_frac)) + (arithmeticT.spec /.equivalence /.arithmetic random.safe_dec)) ))) (with_expansions [ (these (ffi.import java/lang/Double @@ -161,21 +161,21 @@ Test (all _.and (do [! random.monad] - [sample (|> random.safe_frac (of ! each (/.* +1000.0)))] + [sample (|> random.safe_dec (of ! each (/.* +1000.0)))] (all _.and (_.coverage [/.ceil] (let [ceil'd (/.ceil sample)] - (and (|> ceil'd /.int i.frac (/.= ceil'd)) + (and (|> ceil'd /.int i.dec (/.= ceil'd)) (/.>= sample ceil'd) (/.<= +1.0 (/.- sample ceil'd))))) (_.coverage [/.floor] (let [floor'd (/.floor sample)] - (and (|> floor'd /.int i.frac (/.= floor'd)) + (and (|> floor'd /.int i.dec (/.= floor'd)) (/.<= sample floor'd) (/.<= +1.0 (/.- floor'd sample))))) (_.coverage [/.round] (let [round'd (/.round sample)] - (and (|> round'd /.int i.frac (/.= round'd)) + (and (|> round'd /.int i.dec (/.= round'd)) (/.<= +1.0 (/.abs (/.- sample round'd)))))) (_.coverage [/.root_2] (let [sample (/.abs sample)] @@ -191,8 +191,8 @@ )) (do [! random.monad] [.let [~= (/.approximately? ..margin_of_error)] - sample (of ! each (/.* +10.0) random.safe_frac) - power (of ! each (|>> (n.% 10) ++ n.frac) random.nat)] + sample (of ! each (/.* +10.0) random.safe_dec) + power (of ! each (|>> (n.% 10) ++ n.dec) random.nat)] (all _.and (_.coverage [/.exp /.log] (|> sample /.exp /.log (/.approximately? +0.000000000000001 sample))) @@ -215,11 +215,11 @@ (the .public test Test (<| (_.covering /._) - (_.for [.Frac .F64 .Double]) + (_.for [.Dec .F64 .Double]) (`` (all _.and (do random.monad - [left random.safe_frac - right random.safe_frac] + [left random.safe_dec + right random.safe_dec] (all _.and (_.coverage [/.>] (bit#= (/.> left right) @@ -229,7 +229,7 @@ (/.>= right left))) )) (do random.monad - [sample random.safe_frac] + [sample random.safe_dec] (all _.and (_.coverage [/.-] (and (/.= +0.0 (/.- sample sample)) @@ -274,12 +274,12 @@ (/.mod left right)))))) )) (with_expansions [ (all _.and - (let [test (is (-> Frac Bit) + (let [test (is (-> Dec Bit) (function (_ value) (n.= (.nat (ffi.of_long (java/lang/Double::doubleToRawLongBits [(ffi.as_double value)]))) (/.bits value))))] (do random.monad - [sample random.frac] + [sample random.dec] (_.coverage [/.bits] (and (test sample) (test /.biggest) @@ -298,14 +298,14 @@ )] (for .old .jvm - (let [test (is (-> Frac Bit) + (let [test (is (-> Dec Bit) (function (_ expected) (let [actual (|> expected /.bits /.of_bits)] (or (/.= expected actual) (and (/.not_a_number? expected) (/.not_a_number? actual))))))] (do random.monad - [sample random.frac] + [sample random.dec] (_.coverage [/.bits /.of_bits] (and (test sample) (test /.biggest) @@ -314,7 +314,7 @@ (test /.positive_infinity) (test /.negative_infinity))))))) (do random.monad - [expected random.safe_frac] + [expected random.safe_dec] (_.coverage [/.opposite] (let [subtraction! (/.= +0.0 (/.+ (/.opposite expected) expected)) @@ -325,7 +325,7 @@ inverse!)))) (,, (with_template [ ] [(do [! random.monad] - [expected random.safe_frac] + [expected random.safe_dec] (_.coverage [ ] (and (|> expected diff --git a/stdlib/source/test/lux/math/number/int.lux b/stdlib/source/test/lux/math/number/int.lux index 4f7159d32f..e097eb470c 100644 --- a/stdlib/source/test/lux/math/number/int.lux +++ b/stdlib/source/test/lux/math/number/int.lux @@ -32,7 +32,7 @@ ["[0]" / (.only) [// ["n" nat] - ["f" frac] + ["d" dec] ["[0]" i64]]]]) (the signature @@ -232,9 +232,9 @@ (do [! random.monad] [expected (of ! each (/.% +1,000,000) random.int) sample random.int] - (_.coverage [/.frac] - (and (|> expected /.frac f.int (/.= expected)) - (f.number? (/.frac sample))))) + (_.coverage [/.dec] + (and (|> expected /.dec d.int (/.= expected)) + (d.number? (/.dec sample))))) (do [! random.monad] [pattern random.int idx (of ! each (n.% i64.width) random.nat)] diff --git a/stdlib/source/test/lux/math/number/nat.lux b/stdlib/source/test/lux/math/number/nat.lux index 12f11c19f1..72dd3402dc 100644 --- a/stdlib/source/test/lux/math/number/nat.lux +++ b/stdlib/source/test/lux/math/number/nat.lux @@ -32,7 +32,7 @@ [\\library ["[0]" / (.only) [// - ["f" frac]]]]) + ["d" dec]]]]) (the signature Test @@ -155,9 +155,9 @@ (do [! random.monad] [expected (of ! each (/.% 1,000,000) random.nat) sample random.nat] - (_.coverage [/.frac] - (and (|> expected /.frac f.nat (/.= expected)) - (f.number? (/.frac sample))))) + (_.coverage [/.dec] + (and (|> expected /.dec d.nat (/.= expected)) + (d.number? (/.dec sample))))) ..predicate ..signature diff --git a/stdlib/source/test/lux/math/number/rev.lux b/stdlib/source/test/lux/math/number/rev.lux index 713281546f..d6f22838ce 100644 --- a/stdlib/source/test/lux/math/number/rev.lux +++ b/stdlib/source/test/lux/math/number/rev.lux @@ -30,7 +30,7 @@ ["[0]" / (.only) [// (.only hex) ["n" nat] - ["f" frac] + ["d" dec] ["[0]" i64 (.use "[1]#[0]" hash)]]]]) (the signature @@ -181,12 +181,12 @@ (/.= (/.reciprocal sample) (|> sample /.reciprocal .nat /.reciprocal .nat /.reciprocal)))) (do [! random.monad] - [expected (of ! each (|>> f.abs (f.% +1.0)) - random.safe_frac) + [expected (of ! each (|>> d.abs (d.% +1.0)) + random.safe_dec) sample random.rev] - (_.coverage [/.frac] - (and (|> expected f.rev /.frac (f.= expected)) - (f.number? (/.frac sample))))) + (_.coverage [/.dec] + (and (|> expected d.rev /.dec (d.= expected)) + (d.number? (/.dec sample))))) ..signature )))) diff --git a/stdlib/source/test/lux/math/random.lux b/stdlib/source/test/lux/math/random.lux index 27e03f34a4..5a5054c70d 100644 --- a/stdlib/source/test/lux/math/random.lux +++ b/stdlib/source/test/lux/math/random.lux @@ -35,7 +35,7 @@ ["[0]" nat] ["[0]" int] ["[0]" rev] - ["[0]" frac] + ["[0]" dec] ["[0]" ratio] ["[0]" complex]]] [meta @@ -140,7 +140,7 @@ [/.nat nat.equivalence] [/.int int.equivalence] [/.rev rev.equivalence] - [/.safe_frac frac.equivalence] + [/.safe_dec dec.equivalence] [/.ratio ratio.equivalence] [/.complex complex.equivalence] @@ -153,8 +153,8 @@ [/.day day.equivalence] )) (do /.monad - [? (distinct frac.equivalence (/.only frac.number? /.frac))] - (_.coverage [/.frac] + [? (distinct dec.equivalence (/.only dec.number? /.dec))] + (_.coverage [/.dec] ?)) (,, (with_template [] diff --git a/stdlib/source/test/lux/meta/code.lux b/stdlib/source/test/lux/meta/code.lux index 4042b78e70..9e6ff667f9 100644 --- a/stdlib/source/test/lux/meta/code.lux +++ b/stdlib/source/test/lux/meta/code.lux @@ -24,7 +24,7 @@ ["[0]" nat] ["[0]" int] ["[0]" rev] - ["[0]" frac]]] + ["[0]" dec]]] [meta ["[0]" symbol] ["[0]" location] @@ -101,7 +101,7 @@ [\\parser.nat \\parser.this_nat random.nat /.nat nat.equivalence] [\\parser.int \\parser.this_int random.int /.int int.equivalence] [\\parser.rev \\parser.this_rev random.rev /.rev rev.equivalence] - [\\parser.frac \\parser.this_frac random.safe_frac /.frac frac.equivalence] + [\\parser.dec \\parser.this_dec random.safe_dec /.dec dec.equivalence] [\\parser.text \\parser.this_text (random.unicode 1) /.text text.equivalence] [\\parser.local \\parser.this_local ..local /.local text.equivalence] [\\parser.global \\parser.this_global ..global /.symbol symbol.equivalence] @@ -195,7 +195,7 @@ (random#each /.nat random.nat) (random#each /.int random.int) (random#each /.rev random.rev) - (random#each /.frac random.safe_frac) + (random#each /.dec random.safe_dec) (random#each /.text ..random_text) (random#each /.symbol ..random_symbol) (random#each /.form (..random_sequence random)) @@ -237,7 +237,7 @@ (random#each /.nat random.nat) (random#each /.int random.int) (random#each /.rev random.rev) - (random#each /.frac random.safe_frac) + (random#each /.dec random.safe_dec) (random#each /.text ..random_text) (random#each /.symbol ..random_symbol)))] (in [sample sample])) @@ -269,7 +269,7 @@ [/.nat random.nat .#Nat] [/.int random.int .#Int] [/.rev random.rev .#Rev] - [/.frac random.safe_frac .#Frac] + [/.dec random.safe_dec .#Dec] [/.text ..random_text .#Text] [/.symbol ..random_symbol .#Symbol] [/.form (..random_sequence ..random) .#Form] diff --git a/stdlib/source/test/lux/meta/compiler/language/lux/analysis.lux b/stdlib/source/test/lux/meta/compiler/language/lux/analysis.lux index 2b0d7909e7..214237c072 100644 --- a/stdlib/source/test/lux/meta/compiler/language/lux/analysis.lux +++ b/stdlib/source/test/lux/meta/compiler/language/lux/analysis.lux @@ -25,7 +25,7 @@ [number ["n" nat] ["i" int] - ["f" frac] + ["d" dec] ["r" rev]]] [meta ["[0]" static] @@ -119,7 +119,7 @@ [\\parser.bit \\parser.this_bit random.bit /.bit bit#=] [\\parser.nat \\parser.this_nat random.nat /.nat n.=] [\\parser.int \\parser.this_int random.int /.int i.=] - [\\parser.frac \\parser.this_frac random.safe_frac /.frac f.=] + [\\parser.dec \\parser.this_dec random.safe_dec /.dec d.=] [\\parser.rev \\parser.this_rev random.rev /.rev r.=] [\\parser.text \\parser.this_text (random.unicode 10) /.text text#=] [\\parser.local \\parser.this_local random.nat /.local n.=] @@ -238,7 +238,7 @@ nat random.nat int random.int rev random.rev - frac random.frac + dec random.dec text (random.lower_cased 1)] (`` (all _.and (_.coverage [/.unit] @@ -261,7 +261,7 @@ [/.nat nat] [/.int int] [/.rev rev] - [/.frac frac] + [/.dec dec] [/.text text])) )))) diff --git a/stdlib/source/test/lux/meta/compiler/language/lux/analysis/coverage.lux b/stdlib/source/test/lux/meta/compiler/language/lux/analysis/coverage.lux index c9b8d4cca2..ae8d65755f 100644 --- a/stdlib/source/test/lux/meta/compiler/language/lux/analysis/coverage.lux +++ b/stdlib/source/test/lux/meta/compiler/language/lux/analysis/coverage.lux @@ -29,7 +29,7 @@ ["n" nat (.use "[1]#[0]" interval)] ["i" int] ["r" rev] - ["f" frac]]] + ["d" dec]]] [meta [macro ["^" pattern]]] @@ -58,7 +58,7 @@ (random.set n.hash ..spread random.nat) (random.set i.hash ..spread random.int) (random.set r.hash ..spread random.rev) - (random.set f.hash ..spread random.safe_frac) + (random.set d.hash ..spread random.safe_dec) (random.set text.hash ..spread (random.unicode 1)) (all random.and (random.maybe (random#in ..spread)) @@ -99,7 +99,7 @@ [random.nat n.hash /.#Nat //simple.#Nat] [random.int i.hash /.#Int //simple.#Int] [random.rev r.hash /.#Rev //simple.#Rev] - [random.safe_frac f.hash /.#Frac //simple.#Frac] + [random.safe_dec d.hash /.#Dec //simple.#Dec] [(random.unicode 1) text.hash /.#Text //simple.#Text] )) @@ -253,7 +253,7 @@ nat random.nat int random.int rev random.rev - frac random.safe_frac + dec random.safe_dec text (random.unicode 1) arity (of ! each (n.+ 2) ..random_tag) @@ -286,7 +286,7 @@ [/.#Nat n.hash nat ++] [/.#Int i.hash int ++] [/.#Rev r.hash rev ++] - [/.#Frac f.hash frac (f.+ frac)] + [/.#Dec d.hash dec (d.+ dec)] [/.#Text text.hash text (%.format text)] )) )) @@ -432,7 +432,7 @@ [{/.#Nat (set.of_list n.hash (list nat))}] [{/.#Int (set.of_list i.hash (list int))}] [{/.#Rev (set.of_list r.hash (list rev))}] - [{/.#Frac (set.of_list f.hash (list frac))}] + [{/.#Dec (set.of_list d.hash (list dec))}] [{/.#Text (set.of_list text.hash (list text))}] [{/.#Variant {.#None} (dictionary.of_list n.hash (list [tag/0 expected/0]))}] [{/.#Variant {.#Some arity} (dictionary.of_list n.hash (list [tag/0 expected/0]))}] diff --git a/stdlib/source/test/lux/meta/compiler/language/lux/analysis/inference.lux b/stdlib/source/test/lux/meta/compiler/language/lux/analysis/inference.lux index 56d8c47cee..fbcd4954f3 100644 --- a/stdlib/source/test/lux/meta/compiler/language/lux/analysis/inference.lux +++ b/stdlib/source/test/lux/meta/compiler/language/lux/analysis/inference.lux @@ -95,7 +95,7 @@ [.Nat random.nat code.nat] [.Int random.int code.int] [.Rev random.rev code.rev] - [.Frac random.frac code.frac] + [.Dec random.dec code.dec] [.Text (random.lower_cased 1) code.text] )) ))) diff --git a/stdlib/source/test/lux/meta/compiler/language/lux/analysis/pattern.lux b/stdlib/source/test/lux/meta/compiler/language/lux/analysis/pattern.lux index 1fcda690bf..cf993f99a6 100644 --- a/stdlib/source/test/lux/meta/compiler/language/lux/analysis/pattern.lux +++ b/stdlib/source/test/lux/meta/compiler/language/lux/analysis/pattern.lux @@ -12,9 +12,7 @@ ["[0]" bit (.use "[1]#[0]" equivalence)] ["[0]" text (.use "[1]#[0]" equivalence)]] [math - ["[0]" random (.only Random) (.use "[1]#[0]" monad)] - [number - ["f" frac]]] + ["[0]" random (.only Random) (.use "[1]#[0]" monad)]] [test ["_" property (.only Test)]]]] [\\library @@ -43,7 +41,7 @@ expected_nat random.nat expected_int random.int expected_rev random.rev - expected_frac random.frac + expected_dec random.dec expected_text (random.lower_cased 2) expected_lefts random.nat @@ -79,7 +77,7 @@ [/.nat expected_nat] [/.int expected_int] [/.rev expected_rev] - [/.frac expected_frac] + [/.dec expected_dec] [/.text expected_text] )) (_.coverage [/.variant] @@ -96,19 +94,19 @@ (/.nat expected_nat) (/.int expected_int) (/.rev expected_rev) - (/.frac expected_frac) + (/.dec expected_dec) (/.text expected_text))) (/.tuple (list (/.bit actual_bit) (/.nat actual_nat) (/.int actual_int) (/.rev actual_rev) - (/.frac actual_frac) + (/.dec actual_dec) (/.text actual_text))) (and (same? expected_bit actual_bit) (same? expected_nat actual_nat) (same? expected_int actual_int) (same? expected_rev actual_rev) - (same? expected_frac actual_frac) + (same? expected_dec actual_dec) (same? expected_text actual_text)) _ diff --git a/stdlib/source/test/lux/meta/compiler/language/lux/analysis/simple.lux b/stdlib/source/test/lux/meta/compiler/language/lux/analysis/simple.lux index 0dd5d7b8c1..68265188e6 100644 --- a/stdlib/source/test/lux/meta/compiler/language/lux/analysis/simple.lux +++ b/stdlib/source/test/lux/meta/compiler/language/lux/analysis/simple.lux @@ -14,7 +14,7 @@ [math ["[0]" random (.only Random) (.use "[1]#[0]" monad)] [number - ["f" frac]]] + ["d" dec]]] [test ["_" property (.only Test)]]]] [\\library @@ -28,7 +28,7 @@ random.nat random.int random.rev - (random.only (|>> f.not_a_number? not) random.frac) + (random.only (|>> d.not_a_number? not) random.dec) (random.lower_cased 5) )) diff --git a/stdlib/source/test/lux/meta/compiler/language/lux/phase.lux b/stdlib/source/test/lux/meta/compiler/language/lux/phase.lux index 2943cb0ea9..f9311d9e97 100644 --- a/stdlib/source/test/lux/meta/compiler/language/lux/phase.lux +++ b/stdlib/source/test/lux/meta/compiler/language/lux/phase.lux @@ -203,16 +203,16 @@ (try#each (same? expected)) (try.else false))) (_.coverage [/.composite] - (let [phase (/.composite (is (/.Phase Nat Int Frac) + (let [phase (/.composite (is (/.Phase Nat Int Dec) (function (_ archive input) - (of /.monad in (i.frac input)))) - (is (/.Phase Rev Frac Text) + (of /.monad in (i.dec input)))) + (is (/.Phase Rev Dec Text) (function (_ archive input) - (of /.monad in (%.frac input)))))] + (of /.monad in (%.dec input)))))] (|> (phase archive.empty expected) (/.value' [state/0 state/1]) (pipe.when {try.#Success [[state/0' state/1'] actual]} - (and (text#= (%.frac (i.frac expected)) actual) + (and (text#= (%.dec (i.dec expected)) actual) (same? state/0 state/0') (same? state/1 state/1')) diff --git a/stdlib/source/test/lux/meta/compiler/language/lux/phase/analysis.lux b/stdlib/source/test/lux/meta/compiler/language/lux/phase/analysis.lux index 8789ea021d..d7f1403347 100644 --- a/stdlib/source/test/lux/meta/compiler/language/lux/phase/analysis.lux +++ b/stdlib/source/test/lux/meta/compiler/language/lux/phase/analysis.lux @@ -80,8 +80,8 @@ (phase.value state) (try.else false)))) -(the (can_analyse_simple_literal_or_singleton_tuple! lux module/0 [bit/0 nat/0 int/0 rev/0 frac/0 text/0]) - (-> Lux Text [.Bit .Nat .Int .Rev .Frac .Text] Bit) +(the (can_analyse_simple_literal_or_singleton_tuple! lux module/0 [bit/0 nat/0 int/0 rev/0 dec/0 text/0]) + (-> Lux Text [.Bit .Nat .Int .Rev .Dec .Text] Bit) (let [state [extension.#bundle (extension/analysis.bundle ..eval) extension.#state lux]] (`` (and (,, (with_template [ ] @@ -107,7 +107,7 @@ [nat/0 code.nat .Nat //.nat] [int/0 code.int .Int //.int] [rev/0 code.rev .Rev //.rev] - [frac/0 code.frac .Frac //.frac] + [dec/0 code.dec .Dec //.dec] [text/0 code.text .Text //.text] ... Singleton tuple @@ -115,17 +115,17 @@ [nat/0 (<| code.tuple list code.nat) .Nat //.nat] [int/0 (<| code.tuple list code.int) .Int //.int] [rev/0 (<| code.tuple list code.rev) .Rev //.rev] - [frac/0 (<| code.tuple list code.frac) .Frac //.frac] + [dec/0 (<| code.tuple list code.dec) .Dec //.dec] [text/0 (<| code.tuple list code.text) .Text //.text] )) )))) -(the (can_analyse_sum! lux module/0 [@any @bit @nat @int @rev @frac @text] [bit/0 nat/0 int/0 rev/0 frac/0 text/0] [@left @right]) - (-> Lux Text [.Text .Text .Text .Text .Text .Text .Text] [.Bit .Nat .Int .Rev .Frac .Text] [.Text .Text] Bit) +(the (can_analyse_sum! lux module/0 [@any @bit @nat @int @rev @dec @text] [bit/0 nat/0 int/0 rev/0 dec/0 text/0] [@left @right]) + (-> Lux Text [.Text .Text .Text .Text .Text .Text .Text] [.Bit .Nat .Int .Rev .Dec .Text] [.Text .Text] Bit) (let [state [extension.#bundle (extension/analysis.bundle ..eval) extension.#state lux] - :record: (And .Any .Bit .Nat .Int .Rev .Frac .Text) - :variant: (Or .Any .Bit .Nat .Int .Rev .Frac .Text) + :record: (And .Any .Bit .Nat .Int .Rev .Dec .Text) + :variant: (Or .Any .Bit .Nat .Int .Rev .Dec .Text) can_analyse_unary! (`` (and (|> (do phase.monad @@ -164,7 +164,7 @@ [2 #0 nat/0 @nat code.nat //.nat] [3 #0 int/0 @int code.int //.int] [4 #0 rev/0 @rev code.rev //.rev] - [5 #0 frac/0 @frac code.frac //.frac] + [5 #0 dec/0 @dec code.dec //.dec] [5 #1 text/0 @text code.text //.text] )))) @@ -196,7 +196,7 @@ (code.nat nat/0) (code.int int/0) (code.rev rev/0) - (code.frac frac/0) + (code.dec dec/0) (code.text text/0))) (/.phase ..expander archive.empty) (//type.expecting :either:))] @@ -206,13 +206,13 @@ (//.nat nat/?) (//.int int/?) (//.rev rev/?) - (//.frac frac/?) + (//.dec dec/?) (//.text text/?)))]) (and (same? bit/0 bit/?) (same? nat/0 nat/?) (same? int/0 int/?) (same? rev/0 rev/?) - (same? frac/0 frac/?) + (same? dec/0 dec/?) (same? text/0 text/?)) _ @@ -227,16 +227,16 @@ can_analyse_multiary! ))) -(the (can_analyse_variant! lux module/0 [@any @bit @nat @int @rev @frac @text] [bit/0 nat/0 int/0 rev/0 frac/0 text/0] [@left @right]) - (-> Lux Text [.Text .Text .Text .Text .Text .Text .Text] [.Bit .Nat .Int .Rev .Frac .Text] [.Text .Text] Bit) +(the (can_analyse_variant! lux module/0 [@any @bit @nat @int @rev @dec @text] [bit/0 nat/0 int/0 rev/0 dec/0 text/0] [@left @right]) + (-> Lux Text [.Text .Text .Text .Text .Text .Text .Text] [.Bit .Nat .Int .Rev .Dec .Text] [.Text .Text] Bit) (let [state [extension.#bundle (extension/analysis.bundle ..eval) extension.#state lux] :record: {.#Named [module/0 @text] - (type [.Any .Bit .Nat .Int .Rev .Frac .Text])} - slots/* (list @any @bit @nat @int @rev @frac @text) + (type [.Any .Bit .Nat .Int .Rev .Dec .Text])} + slots/* (list @any @bit @nat @int @rev @dec @text) :variant: {.#Named [module/0 @text] - (type (Or .Any .Bit .Nat .Int .Rev .Frac .Text))} - tags/* (list @any @bit @nat @int @rev @frac @text) + (type (Or .Any .Bit .Nat .Int .Rev .Dec .Text))} + tags/* (list @any @bit @nat @int @rev @dec @text) can_analyse_unary! (`` (and (|> (do phase.monad @@ -281,7 +281,7 @@ [2 #0 nat/0 @nat code.nat //.nat] [3 #0 int/0 @int code.int //.int] [4 #0 rev/0 @rev code.rev //.rev] - [5 #0 frac/0 @frac code.frac //.frac] + [5 #0 dec/0 @dec code.dec //.dec] [5 #1 text/0 @text code.text //.text] )))) @@ -320,7 +320,7 @@ (code.nat nat/0) (code.int int/0) (code.rev rev/0) - (code.frac frac/0) + (code.dec dec/0) (code.text text/0))) (/.phase ..expander archive.empty) //type.inferring)] @@ -332,13 +332,13 @@ (//.nat nat/?) (//.int int/?) (//.rev rev/?) - (//.frac frac/?) + (//.dec dec/?) (//.text text/?)))]) (and (same? bit/0 bit/?) (same? nat/0 nat/?) (same? int/0 int/?) (same? rev/0 rev/?) - (same? frac/0 frac/?) + (same? dec/0 dec/?) (same? text/0 text/?)) _ @@ -352,8 +352,8 @@ can_analyse_nullary! can_analyse_multiary!))) -(the (can_analyse_tuple! lux module/0 [bit/0 nat/0 int/0 rev/0 frac/0 text/0]) - (-> Lux Text [.Bit .Nat .Int .Rev .Frac .Text] Bit) +(the (can_analyse_tuple! lux module/0 [bit/0 nat/0 int/0 rev/0 dec/0 text/0]) + (-> Lux Text [.Bit .Nat .Int .Rev .Dec .Text] Bit) (let [state [extension.#bundle (extension/analysis.bundle ..eval) extension.#state lux]] (|> (do phase.monad @@ -362,11 +362,11 @@ (code.nat nat/0) (code.int int/0) (code.rev rev/0) - (code.frac frac/0) + (code.dec dec/0) (code.text text/0))) (/.phase ..expander archive.empty) //type.inferring)] - (in (and (type#= (type [.Any .Bit .Nat .Int .Rev .Frac .Text]) + (in (and (type#= (type [.Any .Bit .Nat .Int .Rev .Dec .Text]) :it:) (when it (//.tuple (list (//.unit) @@ -374,13 +374,13 @@ (//.nat nat/?) (//.int int/?) (//.rev rev/?) - (//.frac frac/?) + (//.dec dec/?) (//.text text/?))) (and (same? bit/0 bit/?) (same? nat/0 nat/?) (same? int/0 int/?) (same? rev/0 rev/?) - (same? frac/0 frac/?) + (same? dec/0 dec/?) (same? text/0 text/?)) _ @@ -391,13 +391,13 @@ (phase.value state) (try.else false)))) -(the (can_analyse_record! lux module/0 [@any @bit @nat @int @rev @frac @text] [bit/0 nat/0 int/0 rev/0 frac/0 text/0]) - (-> Lux Text [.Text .Text .Text .Text .Text .Text .Text] [.Bit .Nat .Int .Rev .Frac .Text] Bit) +(the (can_analyse_record! lux module/0 [@any @bit @nat @int @rev @dec @text] [bit/0 nat/0 int/0 rev/0 dec/0 text/0]) + (-> Lux Text [.Text .Text .Text .Text .Text .Text .Text] [.Bit .Nat .Int .Rev .Dec .Text] Bit) (let [state [extension.#bundle (extension/analysis.bundle ..eval) extension.#state lux] :record: {.#Named [module/0 @text] - (type [.Any .Bit .Nat .Int .Rev .Frac .Text])} - slots/* (list @any @bit @nat @int @rev @frac @text)] + (type [.Any .Bit .Nat .Int .Rev .Dec .Text])} + slots/* (list @any @bit @nat @int @rev @dec @text)] (|> (do phase.monad [_ (//module.declare_labels true slots/* false :record:) [:it: it] (|> (code.tuple (list (code.local @text) (code.text text/0) @@ -405,7 +405,7 @@ (code.local @rev) (code.rev rev/0) (code.local @int) (code.int int/0) (code.local @nat) (code.nat nat/0) - (code.local @frac) (code.frac frac/0) + (code.local @dec) (code.dec dec/0) (code.local @any) (` []))) (/.phase ..expander archive.empty) //type.inferring)] @@ -417,13 +417,13 @@ (//.nat nat/?) (//.int int/?) (//.rev rev/?) - (//.frac frac/?) + (//.dec dec/?) (//.text text/?))) (and (same? bit/0 bit/?) (same? nat/0 nat/?) (same? int/0 int/?) (same? rev/0 rev/?) - (same? frac/0 frac/?) + (same? dec/0 dec/?) (same? text/0 text/?)) _ @@ -659,33 +659,33 @@ (phase.value state) (try.else false)))) -(the (can_analyse_pattern_matching! lux module/0 [@any @bit @nat @int @rev @frac @text] [bit/0 nat/0 int/0 rev/0 frac/0 text/0] $parameter/0) - (-> Lux Text [.Text .Text .Text .Text .Text .Text .Text] [.Bit .Nat .Int .Rev .Frac .Text] Code Bit) +(the (can_analyse_pattern_matching! lux module/0 [@any @bit @nat @int @rev @dec @text] [bit/0 nat/0 int/0 rev/0 dec/0 text/0] $parameter/0) + (-> Lux Text [.Text .Text .Text .Text .Text .Text .Text] [.Bit .Nat .Int .Rev .Dec .Text] Code Bit) (let [state [extension.#bundle (extension/analysis.bundle ..eval) extension.#state lux] :variant: {.#Named [module/0 module/0] - (type (Or .Any .Bit .Nat .Int .Rev .Frac .Text))} - tags/* (list @any @bit @nat @int @rev @frac @text) + (type (Or .Any .Bit .Nat .Int .Rev .Dec .Text))} + tags/* (list @any @bit @nat @int @rev @dec @text) :record: {.#Named [module/0 module/0] - (type (And .Any .Bit .Nat .Int .Rev .Frac .Text))} - slots/* (list @any @bit @nat @int @rev @frac @text) + (type (And .Any .Bit .Nat .Int .Rev .Dec .Text))} + slots/* (list @any @bit @nat @int @rev @dec @text) simple! (`` (and (,, (with_template [ ] [(|> (do phase.monad - [[:it: it] (|> (` ({(, $parameter/0) (, (code.frac frac/0))} (, ( )))) + [[:it: it] (|> (` ({(, $parameter/0) (, (code.dec dec/0))} (, ( )))) (/.phase ..expander archive.empty) //type.inferring)] - (in (and (type#= .Frac :it:) + (in (and (type#= .Dec :it:) (when it {//.#When ( input/?) [[//.#when (//pattern.bind 0) - //.#then (//.frac frac/?)] + //.#then (//.dec dec/?)] (list)]} (and (same? input/?) - (same? frac/0 frac/?)) + (same? dec/0 dec/?)) _ false)))) @@ -696,23 +696,23 @@ (try.else false)) (|> (do phase.monad [[:it: it] (|> (` ({(, ( )) - (, (code.frac frac/0)) + (, (code.dec dec/0)) (, $parameter/0) - (, (code.frac frac/0))} + (, (code.dec dec/0))} (, ( )))) (/.phase ..expander archive.empty) //type.inferring)] - (in (and (type#= .Frac :it:) + (in (and (type#= .Dec :it:) (when it {//.#When ( input/?) [[//.#when ( pattern/?) - //.#then (//.frac frac/?)] + //.#then (//.dec dec/?)] (list [//.#when (//pattern.bind 0) - //.#then (//.frac frac/?)])]} + //.#then (//.dec dec/?)])]} (and (same? input/?) (same? pattern/?) - (same? frac/0 frac/?)) + (same? dec/0 dec/?)) _ false)))) @@ -726,30 +726,30 @@ [nat/0 code.nat //.nat //pattern.nat] [int/0 code.int //.int //pattern.int] [rev/0 code.rev //.rev //pattern.rev] - [frac/0 code.frac //.frac //pattern.frac] + [dec/0 code.dec //.dec //pattern.dec] [text/0 code.text //.text //pattern.text] )))) bit! (|> (do phase.monad [[:it: it] (|> (` ({#0 - (, (code.frac frac/0)) + (, (code.dec dec/0)) #1 - (, (code.frac frac/0))} + (, (code.dec dec/0))} (, (code.bit bit/0)))) (/.phase ..expander archive.empty) //type.inferring)] - (in (and (type#= .Frac :it:) + (in (and (type#= .Dec :it:) (when it {//.#When (//.bit bit/?) [[//.#when (//pattern.bit .false) - //.#then (//.frac false/?)] + //.#then (//.dec false/?)] (list [//.#when (//pattern.bit .true) - //.#then (//.frac true/?)])]} + //.#then (//.dec true/?)])]} (and (same? bit/0 bit/?) - (same? frac/0 false/?) - (same? frac/0 true/?)) + (same? dec/0 false/?) + (same? dec/0 true/?)) _ false)))) @@ -764,24 +764,24 @@ [(|> (do phase.monad [_ (//module.declare_labels false tags/* false :variant:) [:it: it] (|> (` ({{(, (code.local )) (, ( ))} - (, (code.frac frac/0)) + (, (code.dec dec/0)) (, $parameter/0) - (, (code.frac frac/0))} + (, (code.dec dec/0))} {(, (code.local )) (, ( ))})) (/.phase ..expander archive.empty) //type.inferring)] - (in (and (type#= .Frac :it:) + (in (and (type#= .Dec :it:) (when it {//.#When (//.variant [ ( analysis/?)]) [[//.#when (//pattern.variant [ ( pattern/?)]) - //.#then (//.frac match/?)] + //.#then (//.dec match/?)] (list [//.#when (//pattern.bind 0) - //.#then (//.frac mismatch/?)])]} + //.#then (//.dec mismatch/?)])]} (and (same? analysis/?) (same? pattern/?) - (same? frac/0 match/?) - (same? frac/0 mismatch/?)) + (same? dec/0 match/?) + (same? dec/0 mismatch/?)) _ false)))) @@ -795,32 +795,32 @@ [2 #0 nat/0 @nat code.nat //.nat //pattern.nat] [3 #0 int/0 @int code.int //.int //pattern.int] [4 #0 rev/0 @rev code.rev //.rev //pattern.rev] - [5 #0 frac/0 @frac code.frac //.frac //pattern.frac] + [5 #0 dec/0 @dec code.dec //.dec //pattern.dec] [5 #1 text/0 @text code.text //.text //pattern.text] )))) tuple! (|> (do phase.monad [[:it: it] (|> (` ({[#0 (, $parameter/0)] - (, (code.frac frac/0)) + (, (code.dec dec/0)) [#1 (, $parameter/0)] - (, (code.frac frac/0))} + (, (code.dec dec/0))} [(, (code.bit bit/0)) (, (code.nat nat/0))])) (/.phase ..expander archive.empty) //type.inferring)] - (in (and (type#= .Frac :it:) + (in (and (type#= .Dec :it:) (when it {//.#When (//.tuple (list (//.bit bit/?) (//.nat nat/?))) [[//.#when (//pattern.tuple (list (//pattern.bit .false) (//pattern.bind 0))) - //.#then (//.frac false/?)] + //.#then (//.dec false/?)] (list [//.#when (//pattern.tuple (list (//pattern.bit .true) (//pattern.bind 0))) - //.#then (//.frac true/?)])]} + //.#then (//.dec true/?)])]} (and (same? bit/0 bit/?) (same? nat/0 nat/?) - (same? frac/0 false/?) - (same? frac/0 true/?)) + (same? dec/0 false/?) + (same? dec/0 true/?)) _ false)))) @@ -838,48 +838,48 @@ (, (code.symbol [module/0 @nat])) (, (code.nat nat/0)) (, (code.symbol [module/0 @int])) (, (code.int int/0)) (, (code.symbol [module/0 @rev])) (, (code.rev rev/0)) - (, (code.symbol [module/0 @frac])) (, (code.frac frac/0)) + (, (code.symbol [module/0 @dec])) (, (code.dec dec/0)) (, (code.symbol [module/0 @text])) (, (code.text text/0))] - (, (code.frac frac/0)) + (, (code.dec dec/0)) (, $parameter/0) - (, (code.frac frac/0))} + (, (code.dec dec/0))} [(, (code.local @any)) [] (, (code.local @bit)) (, (code.bit bit/0)) (, (code.local @nat)) (, (code.nat nat/0)) (, (code.local @int)) (, (code.int int/0)) (, (code.local @rev)) (, (code.rev rev/0)) - (, (code.local @frac)) (, (code.frac frac/0)) + (, (code.local @dec)) (, (code.dec dec/0)) (, (code.local @text)) (, (code.text text/0))])) (/.phase ..expander archive.empty) //type.inferring)] - (in (and (type#= .Frac :it:) + (in (and (type#= .Dec :it:) (when it {//.#When (//.tuple (list (//.unit) (//.bit bit/?) (//.nat nat/?) (//.int int/?) (//.rev rev/?) - (//.frac frac/?) + (//.dec dec/?) (//.text text/?))) [[//.#when (//pattern.tuple (list (//pattern.unit) (//pattern.bit bit/?') (//pattern.nat nat/?') (//pattern.int int/?') (//pattern.rev rev/?') - (//pattern.frac frac/?') + (//pattern.dec dec/?') (//pattern.text text/?'))) - //.#then (//.frac match/?)] + //.#then (//.dec match/?)] (list [//.#when (//pattern.bind 0) - //.#then (//.frac mismatch/?)])]} + //.#then (//.dec mismatch/?)])]} (and (same? bit/0 bit/?) (same? bit/0 bit/?') (same? nat/0 nat/?) (same? nat/0 nat/?') (same? int/0 int/?) (same? int/0 int/?') (same? rev/0 rev/?) (same? rev/0 rev/?') - (same? frac/0 frac/?) (same? frac/0 frac/?') + (same? dec/0 dec/?) (same? dec/0 dec/?') (same? text/0 text/?) (same? text/0 text/?') - (same? frac/0 match/?) - (same? frac/0 mismatch/?)) + (same? dec/0 match/?) + (same? dec/0 mismatch/?)) _ false)))) @@ -908,7 +908,7 @@ nat/0 random.nat int/0 random.int rev/0 random.rev - frac/0 random.frac + dec/0 random.dec text/0 (random.lower_cased 1) @any (random.lower_cased 2) @@ -916,7 +916,7 @@ @nat (random.lower_cased 4) @int (random.lower_cased 5) @rev (random.lower_cased 6) - @frac (random.lower_cased 7) + @dec (random.lower_cased 7) @text (random.lower_cased 8) @left (random.lower_cased 9) @@ -929,15 +929,15 @@ (all _.and (_.coverage [/.phase] (and (..can_analyse_unit! lux module/0) - (..can_analyse_simple_literal_or_singleton_tuple! lux module/0 [bit/0 nat/0 int/0 rev/0 frac/0 text/0]) - (..can_analyse_sum! lux module/0 [@any @bit @nat @int @rev @frac @text] [bit/0 nat/0 int/0 rev/0 frac/0 text/0] [@left @right]) - (..can_analyse_variant! lux module/0 [@any @bit @nat @int @rev @frac @text] [bit/0 nat/0 int/0 rev/0 frac/0 text/0] [@left @right]) - (..can_analyse_tuple! lux module/0 [bit/0 nat/0 int/0 rev/0 frac/0 text/0]) - (..can_analyse_record! lux module/0 [@any @bit @nat @int @rev @frac @text] [bit/0 nat/0 int/0 rev/0 frac/0 text/0]) + (..can_analyse_simple_literal_or_singleton_tuple! lux module/0 [bit/0 nat/0 int/0 rev/0 dec/0 text/0]) + (..can_analyse_sum! lux module/0 [@any @bit @nat @int @rev @dec @text] [bit/0 nat/0 int/0 rev/0 dec/0 text/0] [@left @right]) + (..can_analyse_variant! lux module/0 [@any @bit @nat @int @rev @dec @text] [bit/0 nat/0 int/0 rev/0 dec/0 text/0] [@left @right]) + (..can_analyse_tuple! lux module/0 [bit/0 nat/0 int/0 rev/0 dec/0 text/0]) + (..can_analyse_record! lux module/0 [@any @bit @nat @int @rev @dec @text] [bit/0 nat/0 int/0 rev/0 dec/0 text/0]) (..can_analyse_function! lux module/0 nat/0 [$abstraction/0 $parameter/0 $abstraction/1 $parameter/1]) (..can_analyse_apply! lux module/0 bit/0 nat/0 [$abstraction/0 $parameter/0 $abstraction/1 $parameter/1]) (..can_analyse_extension! lux module/0 text/0) - (..can_analyse_pattern_matching! lux module/0 [@any @bit @nat @int @rev @frac @text] [bit/0 nat/0 int/0 rev/0 frac/0 text/0] $parameter/0) + (..can_analyse_pattern_matching! lux module/0 [@any @bit @nat @int @rev @dec @text] [bit/0 nat/0 int/0 rev/0 dec/0 text/0] $parameter/0) )) (_.coverage [/.invalid] (`` (and (,, (with_template [] @@ -954,12 +954,12 @@ [(` ({#0} (, (code.bit bit/0))))] [(` ({#0 [] #1} (, (code.bit bit/0))))] - [(` {(, (code.bit bit/0)) (, (code.nat nat/0)) (, (code.int int/0)) (, (code.rev rev/0)) (, (code.frac frac/0)) (, (code.text text/0))})] - [(` {(, (code.nat nat/0)) (, (code.int int/0)) (, (code.rev rev/0)) (, (code.frac frac/0)) (, (code.text text/0)) (, (code.bit bit/0))})] - [(` {(, (code.int int/0)) (, (code.rev rev/0)) (, (code.frac frac/0)) (, (code.text text/0)) (, (code.bit bit/0)) (, (code.nat nat/0))})] - [(` {(, (code.rev rev/0)) (, (code.frac frac/0)) (, (code.text text/0)) (, (code.bit bit/0)) (, (code.nat nat/0)) (, (code.int int/0))})] - [(` {(, (code.frac frac/0)) (, (code.text text/0)) (, (code.bit bit/0)) (, (code.nat nat/0)) (, (code.int int/0)) (, (code.rev rev/0))})] - [(` {(, (code.text text/0)) (, (code.bit bit/0)) (, (code.nat nat/0)) (, (code.int int/0)) (, (code.rev rev/0)) (, (code.frac frac/0))})] + [(` {(, (code.bit bit/0)) (, (code.nat nat/0)) (, (code.int int/0)) (, (code.rev rev/0)) (, (code.dec dec/0)) (, (code.text text/0))})] + [(` {(, (code.nat nat/0)) (, (code.int int/0)) (, (code.rev rev/0)) (, (code.dec dec/0)) (, (code.text text/0)) (, (code.bit bit/0))})] + [(` {(, (code.int int/0)) (, (code.rev rev/0)) (, (code.dec dec/0)) (, (code.text text/0)) (, (code.bit bit/0)) (, (code.nat nat/0))})] + [(` {(, (code.rev rev/0)) (, (code.dec dec/0)) (, (code.text text/0)) (, (code.bit bit/0)) (, (code.nat nat/0)) (, (code.int int/0))})] + [(` {(, (code.dec dec/0)) (, (code.text text/0)) (, (code.bit bit/0)) (, (code.nat nat/0)) (, (code.int int/0)) (, (code.rev rev/0))})] + [(` {(, (code.text text/0)) (, (code.bit bit/0)) (, (code.nat nat/0)) (, (code.int int/0)) (, (code.rev rev/0)) (, (code.dec dec/0))})] )) ))) diff --git a/stdlib/source/test/lux/meta/compiler/language/lux/phase/analysis/complex.lux b/stdlib/source/test/lux/meta/compiler/language/lux/phase/analysis/complex.lux index 91bf9d78ad..69cb75470d 100644 --- a/stdlib/source/test/lux/meta/compiler/language/lux/phase/analysis/complex.lux +++ b/stdlib/source/test/lux/meta/compiler/language/lux/phase/analysis/complex.lux @@ -23,7 +23,7 @@ ["[0]" random (.only Random) (.use "[1]#[0]" monad)] [number ["n" nat] - ["f" frac]]] + ["d" dec]]] [meta ["[0]" code] ["[0]" macro (.only) @@ -101,7 +101,7 @@ [.Nat random.nat code.nat] [.Int random.int code.int] [.Rev random.rev code.rev] - [.Frac (random.only (|>> f.not_a_number? not) random.frac) code.frac] + [.Dec (random.only (|>> d.not_a_number? not) random.dec) code.dec] [.Text (random.lower_cased 1) code.text] )) ))) @@ -126,7 +126,7 @@ [.#Nat //analysis.nat] [.#Int //analysis.int] [.#Rev //analysis.rev] - [.#Frac //analysis.frac] + [.#Dec //analysis.dec] [.#Text //analysis.text]) _ diff --git a/stdlib/source/test/lux/meta/compiler/language/lux/phase/analysis/simple.lux b/stdlib/source/test/lux/meta/compiler/language/lux/phase/analysis/simple.lux index d3047caeea..75d57d6fca 100644 --- a/stdlib/source/test/lux/meta/compiler/language/lux/phase/analysis/simple.lux +++ b/stdlib/source/test/lux/meta/compiler/language/lux/phase/analysis/simple.lux @@ -109,7 +109,7 @@ [/.nat .Nat random.nat /analysis.nat] [/.int .Int random.int /analysis.int] [/.rev .Rev random.rev /analysis.rev] - [/.frac .Frac random.frac /analysis.frac] + [/.dec .Dec random.dec /analysis.dec] [/.text .Text (random.unicode 1) /analysis.text] )) ))))) diff --git a/stdlib/source/test/lux/meta/compiler/language/lux/phase/extension/analysis/lux.lux b/stdlib/source/test/lux/meta/compiler/language/lux/phase/extension/analysis/lux.lux index a34c5a1b24..6b9fdaeb04 100644 --- a/stdlib/source/test/lux/meta/compiler/language/lux/phase/extension/analysis/lux.lux +++ b/stdlib/source/test/lux/meta/compiler/language/lux/phase/extension/analysis/lux.lux @@ -119,37 +119,37 @@ (check_success+ (symbol .int_<#) (list paramC subjectC) Bit)) (_.test "Can convert integer to text." (check_success+ (symbol .int_char#) (list subjectC) Text)) - (_.test "Can convert integer to fraction." - (check_success+ (symbol .int_f64#) (list subjectC) Frac)) + (_.test "Can convert integer to decimal." + (check_success+ (symbol .int_f64#) (list subjectC) Dec)) ))) -(the frac +(the dec Test (do [! r.monad] - [subjectC (|> r.safe_frac (of ! each code.frac)) - paramC (|> r.safe_frac (of ! each code.frac)) - encodedC (|> r.safe_frac (of ! each (|>> %.frac code.text)))] + [subjectC (|> r.safe_dec (of ! each code.dec)) + paramC (|> r.safe_dec (of ! each code.dec)) + encodedC (|> r.safe_dec (of ! each (|>> %.dec code.text)))] (all _.and - (_.test "Can add frac numbers." - (check_success+ (symbol .f64_+#) (list paramC subjectC) Frac)) - (_.test "Can subtract frac numbers." - (check_success+ (symbol .f64_-#) (list paramC subjectC) Frac)) - (_.test "Can multiply frac numbers." - (check_success+ (symbol .f64_*#) (list paramC subjectC) Frac)) - (_.test "Can divide frac numbers." - (check_success+ (symbol .f64_/#) (list paramC subjectC) Frac)) - (_.test "Can calculate remainder of frac numbers." - (check_success+ (symbol .f64_%#) (list paramC subjectC) Frac)) - (_.test "Can test equivalence of frac numbers." + (_.test "Can add dec numbers." + (check_success+ (symbol .f64_+#) (list paramC subjectC) Dec)) + (_.test "Can subtract dec numbers." + (check_success+ (symbol .f64_-#) (list paramC subjectC) Dec)) + (_.test "Can multiply dec numbers." + (check_success+ (symbol .f64_*#) (list paramC subjectC) Dec)) + (_.test "Can divide dec numbers." + (check_success+ (symbol .f64_/#) (list paramC subjectC) Dec)) + (_.test "Can calculate remainder of dec numbers." + (check_success+ (symbol .f64_%#) (list paramC subjectC) Dec)) + (_.test "Can test equivalence of dec numbers." (check_success+ (symbol .f64_=#) (list paramC subjectC) Bit)) - (_.test "Can compare frac numbers." + (_.test "Can compare dec numbers." (check_success+ (symbol .f64_<#) (list paramC subjectC) Bit)) - (_.test "Can convert frac number to integer." + (_.test "Can convert dec number to integer." (check_success+ (symbol .f64_int#) (list subjectC) Int)) - (_.test "Can convert frac number to text." + (_.test "Can convert dec number to text." (check_success+ (symbol .f64_encoded#) (list subjectC) Text)) - (_.test "Can convert text to frac number." - (check_success+ (symbol .f64_decoded#) (list encodedC) (type (Maybe Frac)))) + (_.test "Can convert text to dec number." + (check_success+ (symbol .f64_decoded#) (list encodedC) (type (Maybe Dec)))) ))) (the text @@ -196,7 +196,7 @@ ..lux ..i64 ..int - ..frac + ..dec ..text ..io ))) diff --git a/stdlib/source/test/lux/meta/compiler/language/lux/phase/synthesis/function.lux b/stdlib/source/test/lux/meta/compiler/language/lux/phase/synthesis/function.lux index 401785d429..7f65cdb4dd 100644 --- a/stdlib/source/test/lux/meta/compiler/language/lux/phase/synthesis/function.lux +++ b/stdlib/source/test/lux/meta/compiler/language/lux/phase/synthesis/function.lux @@ -107,7 +107,7 @@ [random_nat random.nat (|>> .i64 synthesis.i64) analysis.nat] [random_int random.int (|>> .i64 synthesis.i64) analysis.int] [random_rev random.rev (|>> .i64 synthesis.i64) analysis.rev] - [random_frac random.frac synthesis.f64 analysis.frac] + [random_dec random.dec synthesis.f64 analysis.dec] [random_text (random.unicode 1) synthesis.text analysis.text] ) @@ -118,7 +118,7 @@ (..random_nat output?))) (random.either (random.either (..random_int output?) (..random_rev output?)) - (random.either (..random_frac output?) + (random.either (..random_dec output?) (..random_text output?))))) (the (random_variant random_value output?) @@ -182,7 +182,7 @@ (do [! random.monad] [bit_test random.bit i64_test random.nat - f64_test random.frac + f64_test random.dec text_test (random.unicode 1) [loop?_input expected_input actual_input] (random_value false) [loop?_output expected_output actual_output] (random_value output?) @@ -227,7 +227,7 @@ analysis.#then actual_output] [analysis.#when (analysis.pattern/nat (.nat i64_test)) analysis.#then actual_output] - [analysis.#when (analysis.pattern/frac f64_test) + [analysis.#when (analysis.pattern/dec f64_test) analysis.#then actual_output] [analysis.#when (analysis.pattern/text text_test) analysis.#then actual_output] diff --git a/stdlib/source/test/lux/meta/compiler/language/lux/phase/synthesis/loop.lux b/stdlib/source/test/lux/meta/compiler/language/lux/phase/synthesis/loop.lux index 7f651be23f..103a20640d 100644 --- a/stdlib/source/test/lux/meta/compiler/language/lux/phase/synthesis/loop.lux +++ b/stdlib/source/test/lux/meta/compiler/language/lux/phase/synthesis/loop.lux @@ -43,7 +43,7 @@ [//.bit random.bit] [//.i64 (of ! each .i64 random.nat)] - [//.f64 random.frac] + [//.f64 random.dec] [//.text (random.unicode 1)] )) ))) @@ -129,7 +129,7 @@ [//.path/bit random.bit] [//.path/i64 (of ! each .i64 random.nat)] - [//.path/f64 random.frac] + [//.path/f64 random.dec] [//.path/text (random.unicode 1)] )) (,, (with_template [] diff --git a/stdlib/source/test/lux/meta/compiler/language/lux/phase/synthesis/primitive.lux b/stdlib/source/test/lux/meta/compiler/language/lux/phase/synthesis/primitive.lux index 63e638b598..5baff5e0dd 100644 --- a/stdlib/source/test/lux/meta/compiler/language/lux/phase/synthesis/primitive.lux +++ b/stdlib/source/test/lux/meta/compiler/language/lux/phase/synthesis/primitive.lux @@ -43,7 +43,7 @@ r.nat r.int r.rev - r.frac + r.dec (r.unicode 5)))] (in {////analysis.#Primitive primitive}))) @@ -61,7 +61,7 @@ [////analysis.#Nat .i64 ////synthesis.#I64 .i64] [////analysis.#Int .i64 ////synthesis.#I64 .i64] [////analysis.#Rev .i64 ////synthesis.#I64 .i64] - [////analysis.#Frac (|>) ////synthesis.#F64 (|>)] + [////analysis.#Dec (|>) ////synthesis.#F64 (|>)] [////analysis.#Text (|>) ////synthesis.#Text (|>)] )) @@ -99,5 +99,5 @@ [////analysis.#Nat ////synthesis.#I64 (r#each .i64 r.nat)] [////analysis.#Int ////synthesis.#I64 (r#each .i64 r.int)] [////analysis.#Rev ////synthesis.#I64 (r#each .i64 r.rev)] - [////analysis.#Frac ////synthesis.#F64 r.frac] + [////analysis.#Dec ////synthesis.#F64 r.dec] [////analysis.#Text ////synthesis.#Text (r.unicode 5)])))))) diff --git a/stdlib/source/test/lux/meta/compiler/language/lux/phase/synthesis/variable.lux b/stdlib/source/test/lux/meta/compiler/language/lux/phase/synthesis/variable.lux index 4a926b0978..9e4de27dfe 100644 --- a/stdlib/source/test/lux/meta/compiler/language/lux/phase/synthesis/variable.lux +++ b/stdlib/source/test/lux/meta/compiler/language/lux/phase/synthesis/variable.lux @@ -59,7 +59,7 @@ [bit_scenario synthesis.bit random.bit] [i64_scenario synthesis.i64 (of ! each .i64 random.nat)] - [f64_scenario synthesis.f64 random.frac] + [f64_scenario synthesis.f64 random.dec] [text_scenario synthesis.text (random.unicode 1)] ) @@ -196,7 +196,7 @@ [synthesis.#Bit random.bit] [synthesis.#I64 (of ! each .i64 random.nat)] - [synthesis.#F64 random.frac] + [synthesis.#F64 random.dec] [synthesis.#Text (random.unicode 1)] ))) (all random.either diff --git a/stdlib/source/test/lux/meta/compiler/language/lux/phase/synthesis/when.lux b/stdlib/source/test/lux/meta/compiler/language/lux/phase/synthesis/when.lux index 1f10753d43..ce4c26163f 100644 --- a/stdlib/source/test/lux/meta/compiler/language/lux/phase/synthesis/when.lux +++ b/stdlib/source/test/lux/meta/compiler/language/lux/phase/synthesis/when.lux @@ -18,7 +18,7 @@ ["n" nat] ["[0]" int] ["[0]" rev] - ["[0]" frac]] + ["[0]" dec]] [collection ["[0]" list (.use "[1]#[0]" functor mix monoid)] ["[0]" set]]] @@ -221,7 +221,7 @@ [random_nat n.hash random.nat (|>> .i64 synthesis.path/i64) (|>> .i64 synthesis.i64) analysis.pattern/nat analysis.nat] [random_int int.hash random.int (|>> .i64 synthesis.path/i64) (|>> .i64 synthesis.i64) analysis.pattern/int analysis.int] [random_rev rev.hash random.rev (|>> .i64 synthesis.path/i64) (|>> .i64 synthesis.i64) analysis.pattern/rev analysis.rev] - [random_frac frac.hash random.frac synthesis.path/f64 synthesis.f64 analysis.pattern/frac analysis.frac] + [random_dec dec.hash random.dec synthesis.path/f64 synthesis.f64 analysis.pattern/dec analysis.dec] [random_text text.hash (random.unicode 1) synthesis.path/text synthesis.text analysis.pattern/text analysis.text] ) @@ -231,7 +231,7 @@ ..random_nat ..random_int ..random_rev - ..random_frac + ..random_dec ..random_text )) @@ -241,8 +241,8 @@ [[lefts/0 lefts/1 lefts/2 lefts/3 lefts/4] (random_five n.hash random.nat) [value/0 value/1 value/2 value/3 value/4] (random_five text.hash (random.unicode 1)) last_is_right? random.bit - [body/0 body/1 body/2 body/3 body/4] (random_five frac.hash random.frac) - .let [path (is (-> Nat Bit Text Frac Path) + [body/0 body/1 body/2 body/3 body/4] (random_five dec.hash random.dec) + .let [path (is (-> Nat Bit Text Dec Path) (function (_ lefts right? value body) (all {synthesis.#Seq} (synthesis.path/side (if right? @@ -250,12 +250,12 @@ {.#Left lefts})) (synthesis.path/text value) {synthesis.#Then (synthesis.f64 body)}))) - branch (is (-> Nat Bit Text Frac Branch) + branch (is (-> Nat Bit Text Dec Branch) (function (_ lefts right? value body) [analysis.#when (analysis.pattern/variant [analysis.#lefts lefts analysis.#right? right? analysis.#value (analysis.pattern/text value)]) - analysis.#then (analysis.frac body)]))]] + analysis.#then (analysis.dec body)]))]] (in [(all {synthesis.#Alt} (path lefts/0 false value/0 body/0) (path lefts/1 false value/1 body/1) @@ -277,10 +277,10 @@ value/mid (random.list mid_size (random.unicode 1)) value/last (random.unicode 1) - body/first random.frac - body/mid (random.list mid_size random.frac) - body/last random.frac - .let [path (is (-> Nat Bit Text Frac Path) + body/first random.dec + body/mid (random.list mid_size random.dec) + body/last random.dec + .let [path (is (-> Nat Bit Text Dec Path) (function (_ lefts right? value body) (if right? (all {synthesis.#Seq} @@ -296,7 +296,7 @@ (synthesis.path/text value) {synthesis.#Pop} {synthesis.#Then (synthesis.f64 body)})))) - branch (is (-> Nat Bit Text Frac Branch) + branch (is (-> Nat Bit Text Dec Branch) (function (_ lefts right? value body) [analysis.#when (if right? (analysis.pattern/tuple (list#composite (list.repeated (++ lefts) (analysis.pattern/unit)) @@ -305,7 +305,7 @@ (list.repeated lefts (analysis.pattern/unit)) (list (analysis.pattern/text value) (analysis.pattern/unit))))) - analysis.#then (analysis.frac body)]))]] + analysis.#then (analysis.dec body)]))]] (in [(list#mix (function (_ left right) {synthesis.#Alt left right}) (path (++ mid_size) true value/last body/last) diff --git a/stdlib/source/test/lux/meta/compiler/language/lux/phase/translation/jvm/primitive.lux b/stdlib/source/test/lux/meta/compiler/language/lux/phase/translation/jvm/primitive.lux index 05804da254..8dcd28170d 100644 --- a/stdlib/source/test/lux/meta/compiler/language/lux/phase/translation/jvm/primitive.lux +++ b/stdlib/source/test/lux/meta/compiler/language/lux/phase/translation/jvm/primitive.lux @@ -16,7 +16,7 @@ ["[0]" random (.only Random)] [number ["[0]" int (.use "[1]#[0]" equivalence)] - ["[0]" frac (.use "[1]#[0]" equivalence)]]] + ["[0]" dec (.use "[1]#[0]" equivalence)]]] [test ["_" property (.only Test)]]]] [\\library @@ -30,7 +30,7 @@ (do [! random.monad] [expected_bit random.bit expected_i64 random.i64 - expected_f64 random.frac + expected_f64 random.dec expected_text (random.lower_cased 1)]) (`` (all _.and (,, (with_template [ <=>] @@ -46,7 +46,7 @@ [/.bit expected_bit Bit bit#=] [/.i64 expected_i64 Int int#=] - [/.f64 expected_f64 Frac frac#=] + [/.f64 expected_f64 Dec dec#=] [/.text expected_text Text text#=] )) )))) diff --git a/stdlib/source/test/lux/meta/compiler/language/lux/phase/translation/jvm/type.lux b/stdlib/source/test/lux/meta/compiler/language/lux/phase/translation/jvm/type.lux index 9b02ab82b4..e36841f9a1 100644 --- a/stdlib/source/test/lux/meta/compiler/language/lux/phase/translation/jvm/type.lux +++ b/stdlib/source/test/lux/meta/compiler/language/lux/phase/translation/jvm/type.lux @@ -25,8 +25,8 @@ (do [! random.monad] []) (all _.and - (_.coverage [/.frac /.text] - (not (type#= /.frac /.text))) + (_.coverage [/.dec /.text] + (not (type#= /.dec /.text))) (_.coverage [/.value /.error] (not (type#= /.value /.error))) (_.coverage [/.lefts] diff --git a/stdlib/source/test/lux/meta/compiler/language/lux/phase/translation/jvm/value.lux b/stdlib/source/test/lux/meta/compiler/language/lux/phase/translation/jvm/value.lux index ec1776db6e..8b2f4f4372 100644 --- a/stdlib/source/test/lux/meta/compiler/language/lux/phase/translation/jvm/value.lux +++ b/stdlib/source/test/lux/meta/compiler/language/lux/phase/translation/jvm/value.lux @@ -16,7 +16,7 @@ ["[0]" random (.only Random)] [number ["[0]" int (.use "[1]#[0]" equivalence)] - ["[0]" frac (.use "[1]#[0]" equivalence)]]] + ["[0]" dec (.use "[1]#[0]" equivalence)]]] [meta [compiler [target @@ -37,7 +37,7 @@ (do [! random.monad] [expected_bit random.bit expected_i64 random.i64 - expected_f64 random.frac + expected_f64 random.dec expected_text (random.lower_cased 1)]) (`` (all _.and (_.coverage [/.field] @@ -60,6 +60,6 @@ [primitive.bit expected_bit Bit bit#= type.boolean] [primitive.i64 expected_i64 Int int#= type.long] - [primitive.f64 expected_f64 Frac frac#= type.double] + [primitive.f64 expected_f64 Dec dec#= type.double] )))) )))) diff --git a/stdlib/source/test/lux/meta/compiler/language/lux/phase/translation/jvm/when.lux b/stdlib/source/test/lux/meta/compiler/language/lux/phase/translation/jvm/when.lux index 0b7f3a8345..2753559054 100644 --- a/stdlib/source/test/lux/meta/compiler/language/lux/phase/translation/jvm/when.lux +++ b/stdlib/source/test/lux/meta/compiler/language/lux/phase/translation/jvm/when.lux @@ -262,7 +262,7 @@ register (of ! each (n.% 10) random.nat) expected_bit random.bit - expected_f64 random.safe_frac + expected_f64 random.safe_dec expected_text (random.lower_cased 1) lefts (of ! each (n.% 10) random.nat)] diff --git a/stdlib/source/test/lux/meta/compiler/language/lux/syntax.lux b/stdlib/source/test/lux/meta/compiler/language/lux/syntax.lux index bfedd9deb7..c518bab584 100644 --- a/stdlib/source/test/lux/meta/compiler/language/lux/syntax.lux +++ b/stdlib/source/test/lux/meta/compiler/language/lux/syntax.lux @@ -45,7 +45,7 @@ (|> r.nat (r#each code.nat)) (|> r.int (r#each code.int)) (|> r.rev (r#each code.rev)) - (|> r.safe_frac (r#each code.frac)))) + (|> r.safe_dec (r#each code.dec)))) textual^ (is (Random Code) (all r.either (do r.monad diff --git a/stdlib/source/test/lux/meta/compiler/language/lux/synthesis.lux b/stdlib/source/test/lux/meta/compiler/language/lux/synthesis.lux index 28c1dfe4e0..e071c25ece 100644 --- a/stdlib/source/test/lux/meta/compiler/language/lux/synthesis.lux +++ b/stdlib/source/test/lux/meta/compiler/language/lux/synthesis.lux @@ -20,7 +20,7 @@ [number ["n" nat] ["[0]" i64] - ["[0]" frac]]] + ["[0]" dec]]] [meta ["[0]" symbol] [macro @@ -88,7 +88,7 @@ [\\parser.bit \\parser.this_bit random.bit synthesis.bit bit.equivalence] [\\parser.i64 \\parser.this_i64 random.i64 synthesis.i64 i64.equivalence] - [\\parser.f64 \\parser.this_f64 random.safe_frac synthesis.f64 frac.equivalence] + [\\parser.f64 \\parser.this_f64 random.safe_dec synthesis.f64 dec.equivalence] [\\parser.text \\parser.this_text (random.unicode 1) synthesis.text text.equivalence] [\\parser.local \\parser.this_local random.nat synthesis.local n.equivalence] [\\parser.foreign \\parser.this_foreign random.nat synthesis.foreign n.equivalence] @@ -102,7 +102,7 @@ (do [! random.monad] [expected_bit random.bit expected_i64 random.i64 - expected_f64 random.safe_frac + expected_f64 random.safe_dec expected_text (random.unicode 1)] (_.coverage [\\parser.tuple] (and (|> (\\parser.value (\\parser.tuple (all <>.and \\parser.bit \\parser.i64 \\parser.f64 \\parser.text)) @@ -113,7 +113,7 @@ (!expect (^.multi {try.#Success [actual_bit actual_i64 actual_f64 actual_text]} (and (of bit.equivalence = expected_bit actual_bit) (of i64.equivalence = expected_i64 actual_i64) - (of frac.equivalence = expected_f64 actual_f64) + (of dec.equivalence = expected_f64 actual_f64) (of text.equivalence = expected_text actual_text))))) (|> (\\parser.value (\\parser.tuple (all <>.and \\parser.bit \\parser.i64 \\parser.f64 \\parser.text)) (list (synthesis.text expected_text))) diff --git a/stdlib/source/test/lux/meta/compiler/language/lux/synthesis/simple.lux b/stdlib/source/test/lux/meta/compiler/language/lux/synthesis/simple.lux index a0db7551cb..bc9c111d37 100644 --- a/stdlib/source/test/lux/meta/compiler/language/lux/synthesis/simple.lux +++ b/stdlib/source/test/lux/meta/compiler/language/lux/synthesis/simple.lux @@ -27,7 +27,7 @@ (all random.or random.bit random.i64 - random.frac + random.dec (random.lower_cased 1) )) diff --git a/stdlib/source/test/lux/meta/compiler/target/js.lux b/stdlib/source/test/lux/meta/compiler/target/js.lux index a81aa17c25..602d00ef35 100644 --- a/stdlib/source/test/lux/meta/compiler/target/js.lux +++ b/stdlib/source/test/lux/meta/compiler/target/js.lux @@ -23,7 +23,7 @@ [number ["n" nat] ["i" int] - ["f" frac] + ["d" dec] ["[0]" i64]]] [meta ["[0]" static] @@ -75,7 +75,7 @@ Test (do [! random.monad] [boolean random.bit - number random.frac + number random.dec int ..int_32 string (random.upper_cased 5)] (all _.and @@ -91,10 +91,10 @@ (expression (|>> (as Bit) (bit#= boolean)) (/.boolean boolean))) (_.coverage [/.number] - (expression (|>> (as Frac) (f.= number)) + (expression (|>> (as Dec) (d.= number)) (/.number number))) (_.coverage [/.int] - (expression (|>> (as Frac) f.int (i.= int)) + (expression (|>> (as Dec) d.int (i.= int)) (/.int int))) (_.coverage [/.string] (expression (|>> (as Text) (text#= string)) @@ -124,21 +124,21 @@ (the test|number Test (do [! random.monad] - [parameter (random.only (|>> (f.= +0.0) not) - random.safe_frac) - subject random.safe_frac] + [parameter (random.only (|>> (d.= +0.0) not) + random.safe_dec) + subject random.safe_dec] (`` (all _.and (,, (with_template [ ] [(_.coverage [] (let [expected ( parameter subject)] - (expression (|>> (as Frac) (f.= expected)) + (expression (|>> (as Dec) (d.= expected)) ( (/.number parameter) (/.number subject)))))] - [/.+ f.+] - [/.- f.-] - [/.* f.*] - [/./ f./] - [/.% f.%] + [/.+ d.+] + [/.- d.-] + [/.* d.*] + [/./ d./] + [/.% d.%] )) (,, (with_template [ ] [(_.coverage [] @@ -146,11 +146,11 @@ (expression (|>> (as Bit) (bit#= expected)) ( (/.number parameter) (/.number subject)))))] - [/.< f.<] - [/.<= f.<=] - [/.> f.>] - [/.>= f.>=] - [/.= f.=] + [/.< d.<] + [/.<= d.<=] + [/.> d.>] + [/.>= d.>=] + [/.= d.=] )) )))) @@ -167,7 +167,7 @@ (,, (with_template [ ] [(_.coverage [] (let [expected ( left right)] - (expression (|>> (as Frac) f.int (i.= expected)) + (expression (|>> (as Dec) d.int (i.= expected)) ( (/.int left) (/.int right)))))] [/.bit_or i64.or] @@ -175,35 +175,35 @@ [/.bit_and i64.and] )) (_.coverage [/.opposite] - (expression (|>> (as Frac) f.int (i.= (i.* -1 i32))) + (expression (|>> (as Dec) d.int (i.= (i.* -1 i32))) (/.opposite (/.i32 i32)))) (_.coverage [/.i32] - (expression (|>> (as Frac) f.int (i.= i32)) + (expression (|>> (as Dec) d.int (i.= i32)) (/.i32 i32))) (_.coverage [/.to_i32] - (expression (|>> (as Frac) f.int (i.= i32)) + (expression (|>> (as Dec) d.int (i.= i32)) (/.to_i32 (/.int i32)))) (_.coverage [/.left_shift] (let [expected (i64.left_shifted shift i16)] - (expression (|>> (as Frac) f.int (i.= expected)) + (expression (|>> (as Dec) d.int (i.= expected)) (/.left_shift (/.int (.int shift)) (/.i32 i16))))) (_.coverage [/.logic_right_shift] (let [expected (i64.right_shifted shift (as_int_32 i16))] - (expression (|>> (as Frac) f.int (i.= expected)) + (expression (|>> (as Dec) d.int (i.= expected)) (/.logic_right_shift (/.int (.int shift)) (/.i32 i16))))) (_.coverage [/.arithmetic_right_shift] (let [expected (i.right_shifted shift i16)] - (expression (|>> (as Frac) f.int (i.= expected)) + (expression (|>> (as Dec) d.int (i.= expected)) (/.arithmetic_right_shift (/.int (.int shift)) (/.i32 i16))))) (_.coverage [/.bit_not] (let [expected (if (i.< +0 i32) (as_int_32 (i64.not i32)) (i64.not (as_int_32 i32)))] - (expression (|>> (as Frac) f.int (i.= expected)) + (expression (|>> (as Dec) d.int (i.= expected)) (/.bit_not (/.i32 i32))))) )))) @@ -212,13 +212,13 @@ (do [! random.monad] [size (of ! each (|>> (n.% 10) ++) random.nat) index (of ! each (n.% size) random.nat) - items (random.list size random.safe_frac) + items (random.list size random.safe_dec) .let [expected (|> items (list.item index) - (try.else f.not_a_number))]] + (try.else d.not_a_number))]] (all _.and (_.coverage [/.array /.at] - (and (expression (|>> (as Frac) (f.= expected)) + (and (expression (|>> (as Dec) (d.= expected)) (/.at (/.int (.int index)) (/.array (list#each /.number items)))) (expression (|>> (as Bit)) @@ -230,23 +230,23 @@ (the test|object Test (do [! random.monad] - [expected random.safe_frac + [expected random.safe_dec field (random.upper_cased 5) dummy (random.only (|>> (text#= field) not) (random.upper_cased 5)) size (of ! each (|>> (n.% 10) ++) random.nat) index (of ! each (n.% size) random.nat) - items (random.list size random.safe_frac)] + items (random.list size random.safe_dec)] (all _.and (_.coverage [/.object /.its] - (expression (|>> (as Frac) (f.= expected)) + (expression (|>> (as Dec) (d.= expected)) (/.its field (/.object (list [field (/.number expected)]))))) (let [expected (|> items (list.item index) - (try.else f.not_a_number))] + (try.else d.not_a_number))] (_.coverage [/.do] - (expression (|>> (as Frac) f.int (i.= (.int index))) + (expression (|>> (as Dec) d.int (i.= (.int index))) (|> (/.array (list#each /.number items)) (/.do "lastIndexOf" (list (/.number expected))))))) (_.coverage [/.undefined] @@ -260,11 +260,11 @@ Test (do [! random.monad] [test random.bit - then random.safe_frac - else random.safe_frac + then random.safe_dec + else random.safe_dec boolean random.bit - number random.frac + number random.dec string (random.upper_cased 5) comment (random.upper_cased 10)] @@ -276,13 +276,13 @@ ..test|object (_.coverage [/.?] (let [expected (if test then else)] - (expression (|>> (as Frac) (f.= expected)) + (expression (|>> (as Dec) (d.= expected)) (/.? (/.boolean test) (/.number then) (/.number else))))) (_.coverage [/.not_a_number?] (and (expression (|>> (as Bit)) - (/.not_a_number? (/.number f.not_a_number))) + (/.not_a_number? (/.number d.not_a_number))) (expression (|>> (as Bit) not) (/.not_a_number? (/.number then))))) (_.coverage [/.type_of] @@ -303,7 +303,7 @@ (expression (|>> (as Text) (text#= "undefined")) (/.type_of /.undefined)))) (_.coverage [/.comment] - (expression (|>> (as Frac) (f.= then)) + (expression (|>> (as Dec) (d.= then)) (/.comment comment (/.number then)))) ))) @@ -311,24 +311,24 @@ (the test|expression Test (do [! random.monad] - [dummy random.safe_frac - expected random.safe_frac] + [dummy random.safe_dec + expected random.safe_dec] (`` (all _.and (_.for [/.Literal] ..test|literal) (_.for [/.Computation] ..test|computation) (_.coverage [/.,] - (expression (|>> (as Frac) (f.= expected)) + (expression (|>> (as Dec) (d.= expected)) (/., (/.number dummy) (/.number expected)))) )))) (the test/var Test (do [! random.monad] - [number/0 random.safe_frac - number/1 random.safe_frac - number/2 random.safe_frac + [number/0 random.safe_dec + number/1 random.safe_dec + number/2 random.safe_dec foreign (random.lower_cased 10) local (random.only (|>> (text#= foreign) not) (random.lower_cased 10)) @@ -336,18 +336,18 @@ $local (/.var local)]] (all _.and (_.coverage [/.var] - (expression (|>> (as Frac) (f.= number/0)) + (expression (|>> (as Dec) (d.= number/0)) (/.apply (/.closure (list $foreign) (/.return $foreign)) (list (/.number number/0))))) (_.coverage [/.define] - (expression (|>> (as Frac) (f.= number/1)) + (expression (|>> (as Dec) (d.= number/1)) (/.apply (/.closure (list $foreign) (all /.then (/.define $local (/.number number/1)) (/.return $local))) (list (/.number number/0))))) (_.coverage [/.declare] - (expression (|>> (as Frac) (f.= number/1)) + (expression (|>> (as Dec) (d.= number/1)) (/.apply (/.closure (list $foreign) (all /.then (/.declare $local) @@ -359,19 +359,19 @@ (the test/location Test (do [! random.monad] - [number/0 random.safe_frac + [number/0 random.safe_dec int/0 ..int_16 $foreign (of ! each /.var (random.lower_cased 10)) field (random.upper_cased 10)] (all _.and (_.coverage [/.set] - (and (expression (|>> (as Frac) (f.= (f.+ number/0 number/0))) + (and (expression (|>> (as Dec) (d.= (d.+ number/0 number/0))) (/.apply (/.closure (list $foreign) (all /.then (/.statement (/.set $foreign (/.+ $foreign $foreign))) (/.return $foreign))) (list (/.number number/0)))) - (expression (|>> (as Frac) (f.= (f.+ number/0 number/0))) + (expression (|>> (as Dec) (d.= (d.+ number/0 number/0))) (let [@ (/.at (/.int +0) $foreign)] (/.apply (/.closure (list $foreign) (all /.then @@ -379,7 +379,7 @@ (/.statement (/.set @ (/.+ @ @))) (/.return @))) (list (/.number number/0))))) - (expression (|>> (as Frac) (f.= (f.+ number/0 number/0))) + (expression (|>> (as Dec) (d.= (d.+ number/0 number/0))) (let [@ (/.its field $foreign)] (/.apply (/.closure (list $foreign) (all /.then @@ -417,13 +417,13 @@ )) (_.coverage [/.Access] (`` (and (,, (with_template [ ] - [(expression (|>> (as Frac) f.int (i.= ( int/0))) + [(expression (|>> (as Dec) d.int (i.= ( int/0))) (/.apply (/.closure (list $foreign) (all /.then (/.statement ( $foreign)) (/.return $foreign))) (list (/.int int/0)))) - (expression (|>> (as Frac) f.int (i.= ( int/0))) + (expression (|>> (as Dec) d.int (i.= ( int/0))) (let [@ (/.at (/.int +0) $foreign)] (/.apply (/.closure (list $foreign) (all /.then @@ -431,7 +431,7 @@ (/.statement ( @)) (/.return @))) (list (/.int int/0))))) - (expression (|>> (as Frac) f.int (i.= ( int/0))) + (expression (|>> (as Dec) d.int (i.= ( int/0))) (let [@ (/.its field $foreign)] (/.apply (/.closure (list $foreign) (all /.then @@ -466,7 +466,7 @@ (all _.and (_.coverage [/.break] (let [expected (i.* (.int expected_inner_iterations) input)] - (expression (|>> (as Frac) f.int (i.= expected)) + (expression (|>> (as Dec) d.int (i.= expected)) (/.apply (/.closure (list $input) (all /.then (/.define $inner_index (/.int +0)) @@ -482,7 +482,7 @@ (list (/.int input)))))) (_.coverage [/.continue] (let [expected (i.* (.int (n.- expected_inner_iterations full_inner_iterations)) input)] - (expression (|>> (as Frac) f.int (i.= expected)) + (expression (|>> (as Dec) d.int (i.= expected)) (/.apply (/.closure (list $input) (all /.then (/.define $inner_index (/.int +0)) @@ -502,7 +502,7 @@ (let [expected (i.* (.int (n.* expected_outer_iterations expected_inner_iterations)) input)] - (expression (|>> (as Frac) f.int (i.= expected)) + (expression (|>> (as Dec) d.int (i.= expected)) (/.apply (/.closure (list $input) (all /.then (/.define $output (/.int +0)) @@ -528,7 +528,7 @@ (let [expected (i.* (.int (n.* (n.- expected_outer_iterations full_outer_iterations) (n.- expected_inner_iterations full_inner_iterations))) input)] - (expression (|>> (as Frac) f.int (i.= expected)) + (expression (|>> (as Dec) d.int (i.= expected)) (/.apply (/.closure (list $input) (all /.then (/.define $output (/.int +0)) @@ -566,7 +566,7 @@ expected|do_while (i.* (.int (n.max 1 iterations)) input)]] (all _.and (_.coverage [/.while] - (expression (|>> (as Frac) f.int (i.= expected|while)) + (expression (|>> (as Dec) d.int (i.= expected|while)) (/.apply (/.closure (list $input) (all /.then (/.define $index (/.int +0)) @@ -579,7 +579,7 @@ (/.return $output))) (list (/.int input))))) (_.coverage [/.do_while] - (expression (|>> (as Frac) f.int (i.= expected|do_while)) + (expression (|>> (as Dec) d.int (i.= expected|do_while)) (/.apply (/.closure (list $input) (all /.then (/.define $index (/.int +0)) @@ -592,7 +592,7 @@ (/.return $output))) (list (/.int input))))) (_.coverage [/.for] - (expression (|>> (as Frac) f.int (i.= expected|while)) + (expression (|>> (as Dec) d.int (i.= expected|while)) (/.apply (/.closure (list $input) (all /.then (/.define $output (/.int +0)) @@ -609,19 +609,19 @@ (the test|exception Test (do [! random.monad] - [expected random.safe_frac - dummy (random.only (|>> (f.= expected) not) - random.safe_frac) + [expected random.safe_dec + dummy (random.only (|>> (d.= expected) not) + random.safe_dec) $ex (of ! each /.var (random.lower_cased 10))] (all _.and (_.coverage [/.try] - (expression (|>> (as Frac) (f.= expected)) + (expression (|>> (as Dec) (d.= expected)) (/.apply (/.closure (list) (/.try (/.return (/.number expected)) [$ex (/.return (/.number dummy))])) (list)))) (_.coverage [/.throw] - (expression (|>> (as Frac) (f.= expected)) + (expression (|>> (as Dec) (d.= expected)) (/.apply (/.closure (list) (/.try (all /.then (/.throw (/.number expected)) @@ -633,30 +633,30 @@ (the test|apply Test (do [! random.monad] - [number/0 random.safe_frac - number/1 random.safe_frac - number/2 random.safe_frac + [number/0 random.safe_dec + number/1 random.safe_dec + number/2 random.safe_dec $arg/0 (of ! each /.var (random.lower_cased 10)) $arg/1 (of ! each /.var (random.lower_cased 11)) $arg/2 (of ! each /.var (random.lower_cased 12))] (`` (all _.and (_.coverage [/.apply_1] - (expression (|>> (as Frac) (f.= number/0)) + (expression (|>> (as Dec) (d.= number/0)) (/.apply_1 (/.closure (list $arg/0) (/.return $arg/0)) (/.number number/0)))) (_.coverage [/.apply_2] - (expression (|>> (as Frac) (f.= (all f.+ number/0 number/1))) + (expression (|>> (as Dec) (d.= (all d.+ number/0 number/1))) (/.apply_2 (/.closure (list $arg/0 $arg/1) (/.return (all /.+ $arg/0 $arg/1))) (/.number number/0) (/.number number/1)))) (_.coverage [/.apply_3] - (expression (|>> (as Frac) (f.= (all f.+ number/0 number/1 number/2))) + (expression (|>> (as Dec) (d.= (all d.+ number/0 number/1 number/2))) (/.apply_3 (/.closure (list $arg/0 $arg/1 $arg/2) (/.return (all /.+ $arg/0 $arg/1 $arg/2))) (/.number number/0) (/.number number/1) (/.number number/2)))) (_.coverage [/.apply] - (expression (|>> (as Frac) (f.= (all f.+ number/0 number/1 number/2))) + (expression (|>> (as Dec) (d.= (all d.+ number/0 number/1 number/2))) (/.apply (/.closure (list $arg/0 $arg/1 $arg/2) (/.return (all /.+ $arg/0 $arg/1 $arg/2))) (list (/.number number/0) (/.number number/1) @@ -666,7 +666,7 @@ (the test|function Test (do [! random.monad] - [number/0 random.safe_frac + [number/0 random.safe_dec iterations (of ! each (n.% 10) random.nat) $self (of ! each /.var (random.lower_cased 1)) $arg/0 (of ! each /.var (random.lower_cased 2)) @@ -674,18 +674,18 @@ $class (of ! each /.var (random.upper_cased 4))] (all _.and (_.coverage [/.closure /.return] - (expression (|>> (as Frac) (f.= number/0)) + (expression (|>> (as Dec) (d.= number/0)) (/.apply (/.closure (list) (/.return (/.number number/0))) (list)))) (_.coverage [/.function] - (expression (|>> (as Frac) f.nat (n.= iterations)) + (expression (|>> (as Dec) d.nat (n.= iterations)) (/.apply_1 (/.function $self (list $arg/0) (/.return (/.? (/.< (/.int (.int iterations)) $arg/0) (/.apply_1 $self (/.+ (/.int +1) $arg/0)) $arg/0))) (/.int +0)))) (_.coverage [/.function_definition] - (expression (|>> (as Frac) f.nat (n.= iterations)) + (expression (|>> (as Dec) d.nat (n.= iterations)) (/.apply (/.closure (list) (all /.then (/.function_definition $self (list $arg/0) @@ -696,7 +696,7 @@ (list)))) (_.coverage [/.new] (let [$this (/.var "this")] - (expression (|>> (as Frac) (f.= number/0)) + (expression (|>> (as Dec) (d.= number/0)) (/.apply_1 (/.closure (list $arg/0) (all /.then (/.function_definition $class (list) @@ -709,9 +709,9 @@ (the test|branching Test (do [! random.monad] - [number/0 random.safe_frac - number/1 random.safe_frac - number/2 random.safe_frac + [number/0 random.safe_dec + number/1 random.safe_dec + number/2 random.safe_dec arg/0 (random.lower_cased 10) arg/1 (random.only (|>> (text#= arg/0) not) (random.lower_cased 10)) @@ -725,14 +725,14 @@ int ..int_16] (all _.and (_.coverage [/.if] - (expression (|>> (as Frac) (f.= (if ??? number/0 number/1))) + (expression (|>> (as Dec) (d.= (if ??? number/0 number/1))) (/.apply (/.closure (list) (/.if (/.boolean ???) (/.return (/.number number/0)) (/.return (/.number number/1)))) (list)))) (_.coverage [/.when] - (expression (|>> (as Frac) (f.= (if ??? number/0 number/1))) + (expression (|>> (as Dec) (d.= (if ??? number/0 number/1))) (/.apply (/.closure (list) (all /.then (/.when (/.boolean ???) @@ -740,9 +740,9 @@ (/.return (/.number number/1)))) (list)))) (_.coverage [/.switch] - (let [number/0' (%.frac number/0) - number/1' (%.frac number/1) - number/2' (%.frac number/2)] + (let [number/0' (%.dec number/0) + number/1' (%.dec number/1) + number/2' (%.dec number/2)] (and (expression (|>> (as Text) (text#= number/0')) (/.apply (/.closure (list) (/.switch (/.number number/0) @@ -770,9 +770,9 @@ (the test|statement Test (do [! random.monad] - [number/0 random.safe_frac - number/1 random.safe_frac - number/2 random.safe_frac + [number/0 random.safe_dec + number/1 random.safe_dec + number/2 random.safe_dec $arg/0 (of ! each /.var (random.lower_cased 10)) $arg/1 (of ! each /.var (random.lower_cased 11)) $arg/2 (of ! each /.var (random.lower_cased 12)) @@ -780,7 +780,7 @@ int ..int_16] (`` (all _.and (_.coverage [/.statement] - (expression (|>> (as Frac) (f.= number/0)) + (expression (|>> (as Dec) (d.= number/0)) (/.apply_1 (/.closure (list $arg/0) (all /.then (/.statement (/.+ $arg/0 $arg/0)) @@ -788,7 +788,7 @@ (/.number number/0)))) (,, (with_template [ ] [(_.coverage [] - (expression (|>> (as Frac) f.int (i.= ( int))) + (expression (|>> (as Dec) d.int (i.= ( int))) (/.apply_1 (/.closure (list $arg/0) (/.return (/., ( $arg/0) $arg/0))) @@ -798,7 +798,7 @@ [/.-- .--] )) (_.coverage [/.then] - (expression (|>> (as Frac) (f.= number/0)) + (expression (|>> (as Dec) (d.= number/0)) (/.apply_2 (/.closure (list $arg/0 $arg/1) (all /.then (/.return $arg/0) @@ -806,7 +806,7 @@ (/.number number/0) (/.number number/1)))) (_.coverage [/.use_strict] - (and (expression (|>> (as Frac) (f.= number/0)) + (and (expression (|>> (as Dec) (d.= number/0)) (/.apply (/.closure (list) (all /.then /.use_strict diff --git a/stdlib/source/test/lux/meta/compiler/target/jvm.lux b/stdlib/source/test/lux/meta/compiler/target/jvm.lux index 19ee032161..7a2a7e0be3 100644 --- a/stdlib/source/test/lux/meta/compiler/target/jvm.lux +++ b/stdlib/source/test/lux/meta/compiler/target/jvm.lux @@ -31,7 +31,7 @@ [number ["n" nat] ["i" int] - ["f" frac] + ["d" dec] ["[0]" i32 (.only I32)] ["[0]" i64]]] [test @@ -250,11 +250,11 @@ (Random java/lang/Float) (of random.monad each (|>> (as java/lang/Double) ffi.double_to_float) - random.frac)) + random.dec)) (the $Float::literal /.float) (the valid_float (Random java/lang/Float) - (random.only (|>> ffi.float_to_double (as Frac) f.not_a_number? not) + (random.only (|>> ffi.float_to_double (as Dec) d.not_a_number? not) ..$Float::random)) (the $Float::primitive (Primitive java/lang/Float) @@ -266,13 +266,13 @@ (the $Double (/type.class "java.lang.Double" (list))) (the $Double::wrap (/.invokestatic ..$Double "valueOf" (/type.method [(list) (list /type.double) ..$Double (list)]))) -(the $Double::random (as (Random java/lang/Double) random.frac)) +(the $Double::random (as (Random java/lang/Double) random.dec)) (the $Double::literal (-> java/lang/Double (Bytecode Any)) - (|>> (as Frac) /.double)) + (|>> (as Dec) /.double)) (the valid_double (Random java/lang/Double) - (random.only (|>> (as Frac) f.not_a_number? not) + (random.only (|>> (as Dec) d.not_a_number? not) ..$Double::random)) (the $Double::primitive (Primitive java/lang/Double) @@ -556,14 +556,14 @@ (<| (..bytecode (for .old (function (_ actual) (or (|> actual (as java/lang/Float) ("jvm feq" expected)) - (and (f.not_a_number? (as Frac (ffi.float_to_double expected))) - (f.not_a_number? (as Frac (ffi.float_to_double (as java/lang/Float actual))))))) + (and (d.not_a_number? (as Dec (ffi.float_to_double expected))) + (d.not_a_number? (as Dec (ffi.float_to_double (as java/lang/Float actual))))))) .jvm (function (_ actual) (or (|> actual (as java/lang/Float) .jvm_object_cast# (.jvm_float_=# (.jvm_object_cast# expected))) - (and (f.not_a_number? (as Frac (ffi.float_to_double expected))) - (f.not_a_number? (as Frac (ffi.float_to_double (as java/lang/Float actual))))))))) + (and (d.not_a_number? (as Dec (ffi.float_to_double expected))) + (d.not_a_number? (as Dec (ffi.float_to_double (as java/lang/Float actual))))))))) (do /.monad [_ bytecode] ..$Float::wrap)))) @@ -611,7 +611,7 @@ comparison (is (-> (Bytecode Any) (-> java/lang/Float java/lang/Float Bit) (Random Bit)) (function (_ instruction standard) (do random.monad - [.let [valid_float (random.only (|>> ffi.float_to_double (as Frac) f.not_a_number? not) + [.let [valid_float (random.only (|>> ffi.float_to_double (as Dec) d.not_a_number? not) ..$Float::random)] expected valid_float actual valid_float @@ -657,14 +657,14 @@ (<| (..bytecode (for .old (function (_ actual) (or (|> actual (as java/lang/Double) ("jvm deq" expected)) - (and (f.not_a_number? (as Frac expected)) - (f.not_a_number? (as Frac actual))))) + (and (d.not_a_number? (as Dec expected)) + (d.not_a_number? (as Dec actual))))) .jvm (function (_ actual) (or (|> actual (as java/lang/Double) .jvm_object_cast# (.jvm_double_=# (.jvm_object_cast# expected))) - (and (f.not_a_number? (as Frac expected)) - (f.not_a_number? (as Frac actual))))))) + (and (d.not_a_number? (as Dec expected)) + (d.not_a_number? (as Dec actual))))))) (do /.monad [_ bytecode] ..$Double::wrap)))) @@ -808,7 +808,7 @@ (all _.and (<| (_.lifted "INVOKESTATIC") (do random.monad - [expected (random.only (|>> (as Frac) f.not_a_number? not) + [expected (random.only (|>> (as Dec) d.not_a_number? not) ..$Double::random)]) (..bytecode (for .old (|>> (as java/lang/Double) ("jvm deq" expected)) @@ -816,20 +816,20 @@ .jvm (|>> (as java/lang/Double) .jvm_object_cast# (.jvm_double_=# (.jvm_object_cast# expected))))) (do /.monad - [_ (/.double (as Frac expected))] + [_ (/.double (as Dec expected))] (/.invokestatic ..$Double "valueOf" (/type.method [(list) (list /type.double) ..$Double (list)])))) (<| (_.lifted "INVOKEVIRTUAL") (do random.monad [expected ..$Double::random]) - (..bytecode (|>> (as Bit) (bit#= (f.not_a_number? (as Frac expected))))) + (..bytecode (|>> (as Bit) (bit#= (d.not_a_number? (as Dec expected))))) (do /.monad - [_ (/.double (as Frac expected)) + [_ (/.double (as Dec expected)) _ ..$Double::wrap _ (/.invokevirtual ..$Double "isNaN" (/type.method [(list) (list) /type.boolean (list)]))] ..$Boolean::wrap)) (<| (_.lifted "INVOKESPECIAL") (do random.monad - [expected (random.only (|>> (as Frac) f.not_a_number? not) + [expected (random.only (|>> (as Dec) d.not_a_number? not) ..$Double::random)]) (..bytecode (for .old (|>> (as java/lang/Double) ("jvm deq" expected)) @@ -839,7 +839,7 @@ (do /.monad [_ (/.new ..$Double) _ /.dup - _ (/.double (as Frac expected))] + _ (/.double (as Dec expected))] (/.invokespecial ..$Double "" (/type.method [(list) (list /type.double) /type.void (list)])))) (<| (_.lifted "INVOKEINTERFACE") (do random.monad diff --git a/stdlib/source/test/lux/meta/compiler/target/lua.lux b/stdlib/source/test/lux/meta/compiler/target/lua.lux index edd8a09832..13f6f2ad34 100644 --- a/stdlib/source/test/lux/meta/compiler/target/lua.lux +++ b/stdlib/source/test/lux/meta/compiler/target/lua.lux @@ -27,7 +27,7 @@ [number ["n" nat] ["i" int] - ["f" frac] + ["d" dec] ["[0]" i64]]] [meta ["[0]" static] @@ -55,7 +55,7 @@ (do [! random.monad] [boolean random.bit int random.int - float random.frac + float random.dec string (random.upper_cased 5)] (all _.and (_.coverage [/.nil] @@ -72,7 +72,7 @@ (expression (|>> (as Int) (i.= int)) (/.int int))) (_.coverage [/.float] - (expression (|>> (as Frac) (f.= float)) + (expression (|>> (as Dec) (d.= float)) (/.float float))) (_.coverage [/.string] (expression (|>> (as Text) (text#= string)) @@ -155,22 +155,22 @@ (the test|float Test (do [! random.monad] - [parameter (random.only (|>> (f.= +0.0) not) - random.safe_frac) - subject random.safe_frac] + [parameter (random.only (|>> (d.= +0.0) not) + random.safe_dec) + subject random.safe_dec] (`` (all _.and (,, (with_template [
]
                    [(_.coverage []
                       (let [expected ( (
 parameter) (
 subject))]
-                        (expression (|>> (as Frac) (f.= expected))
+                        (expression (|>> (as Dec) (d.= expected))
                                     ( (/.float (
 parameter)) (/.float (
 subject))))))]
 
-                   [/.+ f.+ |>]
-                   [/.- f.- |>]
-                   [/.* f.* |>]
-                   [/./ f./ |>]
-                   [/.% f.mod |>]
-                   [/.^ f.pow f.abs]
+                   [/.+ d.+ |>]
+                   [/.- d.- |>]
+                   [/.* d.* |>]
+                   [/./ d./ |>]
+                   [/.% d.mod |>]
+                   [/.^ d.pow d.abs]
                    ))
              (,, (with_template [ ]
                    [(_.coverage []
@@ -178,11 +178,11 @@
                         (expression (|>> (as Bit) (bit#= expected))
                                     ( (/.float parameter) (/.float subject)))))]
 
-                   [/.<  f.<]
-                   [/.<= f.<=]
-                   [/.>  f.>]
-                   [/.>= f.>=]
-                   [/.=  f.=]
+                   [/.<  d.<]
+                   [/.<= d.<=]
+                   [/.>  d.>]
+                   [/.>= d.>=]
+                   [/.=  d.=]
                    ))
              ))))
 
@@ -204,13 +204,13 @@
   (do [! random.monad]
     [size (of ! each (|>> (n.% 10) ++) random.nat)
      index (of ! each (n.% size) random.nat)
-     items (random.list size random.safe_frac)
+     items (random.list size random.safe_dec)
      .let [expected (|> items
                         (list.item index)
                         maybe.trusted)]]
     (all _.and
          (_.coverage [/.array /.item]
-           (and (expression (|>> (as Frac) (f.= expected))
+           (and (expression (|>> (as Dec) (d.= expected))
                             (/.item (/.int (.int (++ index)))
                                     (/.array (list#each /.float items))))
                 (expression (|>> (as Bit))
@@ -225,13 +225,13 @@
 (the test|table
   Test
   (do [! random.monad]
-    [expected random.safe_frac
-     dummy (random.only (|>> (f.= expected) not)
-                        random.safe_frac)
+    [expected random.safe_dec
+     dummy (random.only (|>> (d.= expected) not)
+                        random.safe_dec)
 
      size (of ! each (|>> (n.% 10) ++) random.nat)
      index (of ! each (n.% size) random.nat)
-     items (random.list size random.safe_frac)
+     items (random.list size random.safe_dec)
 
      $self (of ! each /.var (random.lower_cased 10))
      $table (of ! each /.var (random.lower_cased 11))
@@ -242,14 +242,14 @@
      method (random.upper_cased 6)]
     (all _.and
          (_.coverage [/.table /.its]
-           (and (expression (|>> (as Frac) (f.= expected))
+           (and (expression (|>> (as Dec) (d.= expected))
                             (/.its field (/.table (list [field (/.float expected)]))))
                 (expression (|>> (as Bit))
                             (|> (/.table (list [field (/.float expected)]))
                                 (/.its non_field)
                                 (/.= /.nil)))))
          (_.coverage [/.do /.function]
-           (expression (|>> (as Frac) (f.= expected))
+           (expression (|>> (as Dec) (d.= expected))
                        (|> (all /.then
                                 (/.local/1 $table (/.table (list [field (/.float expected)])))
                                 (/.function (/.its method $table) (list $self $arg)
@@ -265,12 +265,12 @@
   Test
   (do [! random.monad]
     [test random.bit
-     then random.safe_frac
-     else random.safe_frac
+     then random.safe_dec
+     else random.safe_dec
 
      boolean random.bit
      int random.int
-     float random.frac
+     float random.dec
      string (random.upper_cased 5)
 
      comment (random.upper_cased 10)]
@@ -305,7 +305,7 @@
                            (/.its "abs")
                            (/.apply (list (/.int int))))))
          (_.coverage [/.comment]
-           (expression (|>> (as Frac) (f.= then))
+           (expression (|>> (as Dec) (d.= then))
                        (/.comment comment
                          (/.float then))))
          )))
@@ -322,9 +322,9 @@
 (the test/var
   Test
   (do [! random.monad]
-    [float/0 random.safe_frac
-     float/1 random.safe_frac
-     float/2 random.safe_frac
+    [float/0 random.safe_dec
+     float/1 random.safe_dec
+     float/2 random.safe_dec
      foreign (random.lower_cased 10)
      local (random.only (|>> (text#= foreign) not)
                         (random.lower_cased 10))
@@ -332,26 +332,26 @@
            $local (/.var local)]]
     (all _.and
          (_.coverage [/.var]
-           (expression (|>> (as Frac) (f.= float/0))
+           (expression (|>> (as Dec) (d.= float/0))
                        (|> (/.return $foreign)
                            (/.closure (list $foreign))
                            (/.apply (list (/.float float/0))))))
          (_.coverage [/.let]
-           (expression (|>> (as Frac) (f.= float/1))
+           (expression (|>> (as Dec) (d.= float/1))
                        (|> (all /.then
                                 (/.let (list $local) (/.float float/1))
                                 (/.return $local))
                            (/.closure (list $foreign))
                            (/.apply (list (/.float float/0))))))
          (_.coverage [/.local/1]
-           (expression (|>> (as Frac) (f.= float/1))
+           (expression (|>> (as Dec) (d.= float/1))
                        (|> (all /.then
                                 (/.local/1 $local (/.float float/1))
                                 (/.return $local))
                            (/.closure (list $foreign))
                            (/.apply (list (/.float float/0))))))
          (_.coverage [/.local]
-           (expression (|>> (as Frac) (f.= float/1))
+           (expression (|>> (as Dec) (d.= float/1))
                        (|> (all /.then
                                 (/.local (list $local))
                                 (/.set (list $local) (/.float float/1))
@@ -363,8 +363,8 @@
 (the test/location
   Test
   (do [! random.monad]
-    [float/0 random.safe_frac
-     float/1 random.safe_frac
+    [float/0 random.safe_dec
+     float/1 random.safe_dec
      int/0 ..int_16
      $foreign (of ! each /.var (random.lower_cased 10))
      $arg/0 (of ! each /.var (random.lower_cased 11))
@@ -372,27 +372,27 @@
      field (random.upper_cased 10)]
     (all _.and
          (_.coverage [/.set]
-           (expression (|>> (as Frac) (f.= (f.+ float/0 float/0)))
+           (expression (|>> (as Dec) (d.= (d.+ float/0 float/0)))
                        (|> (all /.then
                                 (/.set (list $foreign) (/.+ $foreign $foreign))
                                 (/.return $foreign))
                            (/.closure (list $foreign))
                            (/.apply (list (/.float float/0))))))
          (_.coverage [/.multi]
-           (and (expression (|>> (as Frac) (f.= float/0))
+           (and (expression (|>> (as Dec) (d.= float/0))
                             (|> (all /.then
                                      (/.set (list $arg/0 $arg/1) (/.multi (list (/.float float/0) (/.float float/1))))
                                      (/.return $arg/0))
                                 (/.closure (list))
                                 (/.apply (list))))
-                (expression (|>> (as Frac) (f.= float/1))
+                (expression (|>> (as Dec) (d.= float/1))
                             (|> (all /.then
                                      (/.set (list $arg/0 $arg/1) (/.multi (list (/.float float/0) (/.float float/1))))
                                      (/.return $arg/1))
                                 (/.closure (list))
                                 (/.apply (list))))))
          (_.coverage [/.Access]
-           (and (expression (|>> (as Frac) (f.= (f.+ float/0 float/0)))
+           (and (expression (|>> (as Dec) (d.= (d.+ float/0 float/0)))
                             (let [@ (/.item (/.int +1) $foreign)]
                               (|> (all /.then
                                        (/.set (list $foreign) (/.array (list $foreign)))
@@ -400,7 +400,7 @@
                                        (/.return @))
                                   (/.closure (list $foreign))
                                   (/.apply (list (/.float float/0))))))
-                (expression (|>> (as Frac) (f.= (f.+ float/0 float/0)))
+                (expression (|>> (as Dec) (d.= (d.+ float/0 float/0)))
                             (let [@ (/.its field $foreign)]
                               (|> (all /.then
                                        (/.set (list $foreign) (/.table (list [field $foreign])))
@@ -563,14 +563,14 @@
 (the test|exception
   Test
   (do [! random.monad]
-    [expected random.safe_frac
-     dummy (random.only (|>> (f.= expected) not)
-                        random.safe_frac)
+    [expected random.safe_dec
+     dummy (random.only (|>> (d.= expected) not)
+                        random.safe_dec)
      $verdict (of ! each /.var (random.lower_cased 10))
      $outcome (of ! each /.var (random.lower_cased 11))]
     (all _.and
          (_.coverage [/.pcall/1]
-           (expression (|>> (as Frac) (f.= expected))
+           (expression (|>> (as Dec) (d.= expected))
                        (|> (all /.then
                                 (/.let (list $verdict $outcome) (/.pcall/1 (/.closure (list)
                                                                                       (/.return (/.float expected)))))
@@ -580,7 +580,7 @@
                            (/.closure (list))
                            (/.apply (list)))))
          (_.coverage [/.error/1]
-           (expression (|>> (as Frac) (f.= expected))
+           (expression (|>> (as Dec) (d.= expected))
                        (|> (all /.then
                                 (/.let (list $verdict $outcome) (/.pcall/1 (/.closure (list)
                                                                                       (all /.then
@@ -592,7 +592,7 @@
                            (/.closure (list))
                            (/.apply (list)))))
          (_.coverage [/.error/2]
-           (expression (|>> (as Frac) (f.= expected))
+           (expression (|>> (as Dec) (d.= expected))
                        (|> (all /.then
                                 (/.let (list $verdict $outcome) (/.pcall/1 (/.closure (list)
                                                                                       (all /.then
@@ -608,7 +608,7 @@
 (the test|function
   Test
   (do [! random.monad]
-    [float/0 random.safe_frac
+    [float/0 random.safe_dec
      iterations (of ! each (n.% 10) random.nat)
      $self (of ! each /.var (random.lower_cased 1))
      $arg/0 (of ! each /.var (random.lower_cased 2))
@@ -616,7 +616,7 @@
      $class (of ! each /.var (random.upper_cased 4))]
     (all _.and
          (_.coverage [/.closure /.return]
-           (expression (|>> (as Frac) (f.= float/0))
+           (expression (|>> (as Dec) (d.= float/0))
                        (/.apply (list)
                                 (/.closure (list) (/.return (/.float float/0))))))
          (_.coverage [/.local_function]
@@ -630,15 +630,15 @@
                            (/.closure (list))
                            (/.apply (list)))))
          (do [! random.monad]
-           [float/0 random.safe_frac
-            float/1 random.safe_frac
-            float/2 random.safe_frac
+           [float/0 random.safe_dec
+            float/1 random.safe_dec
+            float/2 random.safe_dec
             $arg/0 (of ! each /.var (random.lower_cased 10))
             $arg/1 (of ! each /.var (random.lower_cased 11))
             $arg/2 (of ! each /.var (random.lower_cased 12))]
            (`` (all _.and
                     (_.coverage [/.apply]
-                      (expression (|>> (as Frac) (f.= (all f.+ float/0 float/1 float/2)))
+                      (expression (|>> (as Dec) (d.= (all d.+ float/0 float/1 float/2)))
                                   (/.apply (list (/.float float/0)
                                                  (/.float float/1)
                                                  (/.float float/2))
@@ -649,19 +649,19 @@
 (the test|branching
   Test
   (do [! random.monad]
-    [float/0 random.safe_frac
-     float/1 random.safe_frac
+    [float/0 random.safe_dec
+     float/1 random.safe_dec
      ??? random.bit]
     (all _.and
          (_.coverage [/.if]
-           (expression (|>> (as Frac) (f.= (if ??? float/0 float/1)))
+           (expression (|>> (as Dec) (d.= (if ??? float/0 float/1)))
                        (|> (/.if (/.boolean ???)
                              (/.return (/.float float/0))
                              (/.return (/.float float/1)))
                            (/.closure (list))
                            (/.apply (list)))))
          (_.coverage [/.when]
-           (expression (|>> (as Frac) (f.= (if ??? float/0 float/1)))
+           (expression (|>> (as Dec) (d.= (if ??? float/0 float/1)))
                        (|> (all /.then
                                 (/.when (/.boolean ???)
                                   (/.return (/.float float/0)))
@@ -689,13 +689,13 @@
 (the test|statement
   Test
   (do [! random.monad]
-    [float/0 random.safe_frac
-     float/1 random.safe_frac
+    [float/0 random.safe_dec
+     float/1 random.safe_dec
      $arg/0 (of ! each /.var (random.lower_cased 10))
      $arg/1 (of ! each /.var (random.lower_cased 11))]
     (`` (all _.and
              (_.coverage [/.statement /.then /.print/1]
-               (expression (|>> (as Frac) (f.= float/0))
+               (expression (|>> (as Dec) (d.= float/0))
                            (|> (all /.then
                                     (/.statement (/.print/1 $arg/0))
                                     (/.return $arg/0))
diff --git a/stdlib/source/test/lux/meta/compiler/target/python.lux b/stdlib/source/test/lux/meta/compiler/target/python.lux
index 040e69b1a6..a5a0a34f78 100644
--- a/stdlib/source/test/lux/meta/compiler/target/python.lux
+++ b/stdlib/source/test/lux/meta/compiler/target/python.lux
@@ -27,7 +27,7 @@
     [number
      ["n" nat]
      ["i" int]
-     ["f" frac]
+     ["d" dec]
      ["[0]" i64]]]
    [meta
     ["[0]" static]
@@ -52,7 +52,7 @@
   Test
   (do [! random.monad]
     [bool random.bit
-     float random.frac
+     float random.dec
      int random.int
      string (random.upper_cased 1)]
     (all _.and
@@ -75,7 +75,7 @@
          ...          (expression (|>> (as Int) (i.= int))
          ...                      (/.long int)))
          (_.coverage [/.float]
-           (expression (|>> (as Frac) (f.= float))
+           (expression (|>> (as Dec) (d.= float))
                        (/.float float)))
          (_.coverage [/.string]
            (expression (|>> (as Text) (text#= string))
@@ -108,22 +108,22 @@
 (the test|float
   Test
   (do [! random.monad]
-    [parameter (random.only (|>> (f.= +0.0) not)
-                            random.safe_frac)
-     subject random.safe_frac]
+    [parameter (random.only (|>> (d.= +0.0) not)
+                            random.safe_dec)
+     subject random.safe_dec]
     (`` (all _.and
              (,, (with_template [  
]
                    [(_.coverage []
                       (let [expected ( (
 parameter) (
 subject))]
-                        (expression (|>> (as Frac) (f.= expected))
+                        (expression (|>> (as Dec) (d.= expected))
                                     ( (/.float (
 parameter)) (/.float (
 subject))))))]
 
-                   [/.+ f.+ |>]
-                   [/.- f.- |>]
-                   [/.* f.* |>]
-                   [/./ f./ |>]
-                   [/.% f.mod |>]
-                   [/.** f.pow f.abs]
+                   [/.+ d.+ |>]
+                   [/.- d.- |>]
+                   [/.* d.* |>]
+                   [/./ d./ |>]
+                   [/.% d.mod |>]
+                   [/.** d.pow d.abs]
                    ))
              (,, (with_template [ ]
                    [(_.coverage []
@@ -131,17 +131,17 @@
                         (expression (|>> (as Bit) (bit#= expected))
                                     ( (/.float parameter) (/.float subject)))))]
 
-                   [/.<  f.<]
-                   [/.<= f.<=]
-                   [/.>  f.>]
-                   [/.>= f.>=]
-                   [/.=  f.=]
+                   [/.<  d.<]
+                   [/.<= d.<=]
+                   [/.>  d.>]
+                   [/.>= d.>=]
+                   [/.=  d.=]
                    ))
              (_.coverage [/.float/1]
-               (expression (|>> (as Frac) (f.= subject))
-                           (/.float/1 (/.string (%.frac subject)))))
+               (expression (|>> (as Dec) (d.= subject))
+                           (/.float/1 (/.string (%.dec subject)))))
              (_.coverage [/.repr/1]
-               (expression (|>> (as Text) (text#= (text.replaced "+" "" (%.frac subject))))
+               (expression (|>> (as Text) (text#= (text.replaced "+" "" (%.dec subject))))
                            (/.repr/1 (/.float subject))))
              ))))
 
@@ -168,7 +168,7 @@
              (,, (with_template [ ]
                    [(_.coverage []
                       (let [expected ( left right)]
-                        (expression (|>> (as Frac) f.int (i.= expected))
+                        (expression (|>> (as Dec) d.int (i.= expected))
                                     ( (/.int left) (/.int right)))))]
 
                    [/.bit_or i64.or]
@@ -190,12 +190,12 @@
                            (/.opposite (/.int left))))
              (_.coverage [/.bit_shl]
                (let [expected (i64.left_shifted shift i16)]
-                 (expression (|>> (as Frac) f.int (i.= expected))
+                 (expression (|>> (as Dec) d.int (i.= expected))
                              (/.bit_shl (/.int (.int shift))
                                         (/.int i16)))))
              (_.coverage [/.bit_shr]
                (let [expected (i.right_shifted shift i16)]
-                 (expression (|>> (as Frac) f.int (i.= expected))
+                 (expression (|>> (as Dec) d.int (i.= expected))
                              (/.bit_shr (/.int (.int shift))
                                         (/.int i16)))))
              (_.coverage [/.int/1]
@@ -234,10 +234,10 @@
   (do [! random.monad]
     [size (of ! each (|>> (n.% 10) ++) random.nat)
      index (of ! each (n.% size) random.nat)
-     items (random.list size random.safe_frac)
+     items (random.list size random.safe_dec)
      .let [expected (|> items
                         (list.item index)
-                        (maybe.else f.not_a_number))]
+                        (maybe.else d.not_a_number))]
      from (of ! each (n.% size) random.nat)
      plus (of ! each (n.% (n.- from size)) random.nat)
      .let [slice_from|size (n.- from size)
@@ -247,11 +247,11 @@
          (_.for [/.item]
                 (all _.and
                      (_.coverage [/.list]
-                       (expression (|>> (as Frac) (f.= expected))
+                       (expression (|>> (as Dec) (d.= expected))
                                    (/.item (/.int (.int index))
                                            (/.list (list#each /.float items)))))
                      (_.coverage [/.tuple]
-                       (expression (|>> (as Frac) (f.= expected))
+                       (expression (|>> (as Dec) (d.= expected))
                                    (/.item (/.int (.int index))
                                            (/.tuple (list#each /.float items)))))))
          (_.coverage [/.slice /.len/1]
@@ -269,7 +269,7 @@
 (the test|dict
   Test
   (do [! random.monad]
-    [expected random.safe_frac
+    [expected random.safe_dec
      field (random.upper_cased 5)
      dummy (random.only (|>> (text#= field) not)
                         (random.upper_cased 5))
@@ -277,7 +277,7 @@
            dummy (/.string dummy)]]
     (all _.and
          (_.coverage [/.dict]
-           (expression (|>> (as Frac) (f.= expected))
+           (expression (|>> (as Dec) (d.= expected))
                        (/.item field (/.dict (list [field (/.float expected)])))))
          (_.coverage [/.in?]
            (and (expression (|>> (as Bit) not)
@@ -290,11 +290,11 @@
   Test
   (do [! random.monad]
     [test random.bit
-     then random.safe_frac
-     else random.safe_frac
+     then random.safe_dec
+     else random.safe_dec
 
      bool random.bit
-     float (random.only (|>> f.not_a_number? not) random.frac)
+     float (random.only (|>> d.not_a_number? not) random.dec)
      string (random.upper_cased 5)
 
      comment (random.upper_cased 10)
@@ -309,19 +309,19 @@
          ..test|dict
          (_.coverage [/.?]
            (let [expected (if test then else)]
-             (expression (|>> (as Frac) (f.= expected))
+             (expression (|>> (as Dec) (d.= expected))
                          (/.? (/.bool test)
                               (/.float then)
                               (/.float else)))))
          (_.coverage [/.comment]
-           (expression (|>> (as Frac) (f.= then))
+           (expression (|>> (as Dec) (d.= then))
                        (/.comment comment
                          (/.float then))))
          (_.coverage [/.__import__/1]
            (expression (function.constant true)
                        (/.__import__/1 (/.string "math"))))
          (_.coverage [/.do]
-           (expression (|>> (as Frac) (f.= (f.ceil float)))
+           (expression (|>> (as Dec) (d.= (d.ceil float)))
                        (|> (/.__import__/1 (/.string "math"))
                            (/.do "ceil" (list (/.float float))))))
          (_.coverage [/.is]
@@ -339,20 +339,20 @@
 (the test|function
   Test
   (do [! random.monad]
-    [float/0 random.safe_frac
-     float/1 random.safe_frac
-     float/2 random.safe_frac
+    [float/0 random.safe_dec
+     float/1 random.safe_dec
+     float/2 random.safe_dec
      $arg/0 (of ! each /.var (random.lower_cased 10))
      $arg/1 (of ! each /.var (random.lower_cased 11))
      $arg/2 (of ! each /.var (random.lower_cased 12))]
     (all _.and
          (_.coverage [/.lambda]
-           (expression (|>> (as Frac) (f.= float/0))
+           (expression (|>> (as Dec) (d.= float/0))
                        (/.apply (list)
                                 (/.lambda (list)
                                           (/.float float/0)))))
          (_.coverage [/.apply]
-           (expression (|>> (as Frac) (f.= (all f.+ float/0 float/1 float/2)))
+           (expression (|>> (as Dec) (d.= (all d.+ float/0 float/1 float/2)))
                        (/.apply (list (/.float float/0) (/.float float/1) (/.float float/2))
                                 (/.lambda (list $arg/0 $arg/1 $arg/2)
                                           (all /.+ $arg/0 $arg/1 $arg/2)))))
@@ -361,8 +361,8 @@
 (the test|var
   Test
   (do [! random.monad]
-    [expected/0 random.safe_frac
-     expected/1 random.safe_frac
+    [expected/0 random.safe_dec
+     expected/1 random.safe_dec
      poly_choice (of ! each (n.% 2) random.nat)
      .let [keyword (|>> %.nat (format "k") /.string)
            keyword/0 (keyword 0)
@@ -375,20 +375,20 @@
      $choice (of ! each (|>> %.nat (format "c") /.var) random.nat)]
     (all _.and
          (_.coverage [/.Single /.SVar /.var]
-           (expression (|>> (as Frac) (f.= expected/0))
+           (expression (|>> (as Dec) (d.= expected/0))
                        (/.apply (list (/.float expected/0))
                                 (/.lambda (list $var) $var))))
          (_.for [/.Poly /.PVar]
                 (all _.and
                      (_.coverage [/.poly]
-                       (expression (|>> (as Frac) (f.= expected/?))
+                       (expression (|>> (as Dec) (d.= expected/?))
                                    (/.apply (list (/.int (.int poly_choice))
                                                   (/.float expected/0)
                                                   (/.float expected/1))
                                             (/.lambda (list $choice (/.poly $var))
                                                       (/.item $choice $var)))))
                      (_.coverage [/.splat_poly]
-                       (expression (|>> (as Frac) (f.= expected/?))
+                       (expression (|>> (as Dec) (d.= expected/?))
                                    (/.apply (list (/.int (.int poly_choice))
                                                   (/.splat_poly
                                                    (/.list (list (/.float expected/0)
@@ -407,7 +407,7 @@
                                             (/.lambda (list $choice (/.keyword $var))
                                                       (/.len/1 $var)))))
                      (_.coverage [/.splat_keyword]
-                       (expression (|>> (as Frac) (f.= expected/?))
+                       (expression (|>> (as Dec) (d.= expected/?))
                                    (/.apply (list keyword_choice
                                                   (/.splat_keyword
                                                    (/.dict (list [keyword/0 (/.float expected/0)]
@@ -420,8 +420,8 @@
 (the test|expression
   Test
   (do [! random.monad]
-    [dummy random.safe_frac
-     expected random.safe_frac]
+    [dummy random.safe_dec
+     expected random.safe_dec]
     (`` (all _.and
              (_.for [/.Literal]
                     ..test|literal)
@@ -451,13 +451,13 @@
   Test
   (do [! random.monad]
     [$var/0 (of ! each (|>> %.nat (format "v0_") /.var) random.nat)
-     expected/0 random.safe_frac
-     dummy/0 random.safe_frac
+     expected/0 random.safe_dec
+     dummy/0 random.safe_dec
      field (of ! each /.string (random.upper_cased 1))]
     (all _.and
          (_.coverage [/.item]
            (`` (and (,, (with_template []
-                          [(expression (|>> (as Frac) (f.= expected/0))
+                          [(expression (|>> (as Dec) (d.= expected/0))
                                        (/.item (/.int +0)
                                                ( (list (/.float expected/0)))))]
 
@@ -470,10 +470,10 @@
                                 (/.set (list $var/0) (/.list (list (/.float dummy/0))))
                                 (/.set (list (/.item (/.int +0) $var/0)) (/.float expected/0))
                                 (/.set (list $output) (/.item (/.int +0) $var/0)))))
-                        (as Frac)
-                        (f.= expected/0))
+                        (as Dec)
+                        (d.= expected/0))
 
-                    (expression (|>> (as Frac) (f.= expected/0))
+                    (expression (|>> (as Dec) (d.= expected/0))
                                 (/.item field (/.dict (list [field (/.float expected/0)]))))
                     (|> (..statement
                          (function (_ $output)
@@ -481,8 +481,8 @@
                                 (/.set (list $var/0) (/.dict (list [field (/.float dummy/0)])))
                                 (/.set (list (/.item field $var/0)) (/.float expected/0))
                                 (/.set (list $output) (/.item field $var/0)))))
-                        (as Frac)
-                        (f.= expected/0)))))
+                        (as Dec)
+                        (d.= expected/0)))))
          )))
 
 (the test|location
@@ -491,9 +491,9 @@
     [$var/0 (of ! each (|>> %.nat (format "v0_") /.var) random.nat)
      $var/1 (of ! each (|>> %.nat (format "v1_") /.var) random.nat)
      $def (of ! each (|>> %.nat (format "def_") /.var) random.nat)
-     expected/0 random.safe_frac
-     expected/1 random.safe_frac
-     dummy/0 random.safe_frac
+     expected/0 random.safe_dec
+     expected/1 random.safe_dec
+     dummy/0 random.safe_dec
      field/0 (of ! each /.string (random.upper_cased 1))]
     (all _.and
          (_.coverage [/.set]
@@ -502,8 +502,8 @@
                   (all /.then
                        (/.set (list $var/0) (/.float expected/0))
                        (/.set (list $output) $var/0))))
-               (as Frac)
-               (f.= expected/0)))
+               (as Dec)
+               (d.= expected/0)))
          (_.coverage [/.multi]
            (`` (and (,, (with_template [ ]
                           [(|> (..statement
@@ -511,8 +511,8 @@
                                   (all /.then
                                        (/.set (list $var/0 $var/1) (/.multi (list (/.float expected/0) (/.float expected/1))))
                                        (/.set (list $output) ))))
-                               (as Frac)
-                               (f.= ))]
+                               (as Dec)
+                               (d.= ))]
 
                           [$var/0 expected/0]
                           [$var/1 expected/1]
@@ -524,16 +524,16 @@
                             (/.set (list $var/0) (/.list (list (/.float dummy/0) (/.float expected/0))))
                             (/.delete (/.item (/.int +0) $var/0))
                             (/.set (list $output) (/.item (/.int +0) $var/0)))))
-                    (as Frac)
-                    (f.= expected/0))
+                    (as Dec)
+                    (d.= expected/0))
                 (|> (..statement
                      (function (_ $output)
                        (all /.then
                             (/.set (list $var/0) (/.list (list (/.float dummy/0) (/.float expected/0))))
                             (/.delete (/.slice (/.int +0) (/.int +1) $var/0))
                             (/.set (list $output) (/.item (/.int +0) $var/0)))))
-                    (as Frac)
-                    (f.= expected/0))
+                    (as Dec)
+                    (d.= expected/0))
                 (|> (..statement
                      (function (_ $output)
                        (all /.then
@@ -541,8 +541,8 @@
                             (/.delete (/.slice_from (/.int +0) $var/0))
                             (/.statement (/.do "append" (list (/.float expected/0)) $var/0))
                             (/.set (list $output) (/.item (/.int +0) $var/0)))))
-                    (as Frac)
-                    (f.= expected/0))
+                    (as Dec)
+                    (d.= expected/0))
                 (|> (..statement
                      (function (_ $output)
                        (all /.then
@@ -566,7 +566,7 @@
                 (function (_ $output)
                   (all /.then
                        (/.def $def (list $var/0)
-                         (/.return (/.in? /.globals/0 (/.string (/.code $var/0)))))
+                              (/.return (/.in? /.globals/0 (/.string (/.code $var/0)))))
                        (/.set (list $output) (/.and (/.not (/.in? /.globals/0 (/.string (/.code $var/0))))
                                                     (/.not (/.apply (list (/.float dummy/0)) $def))))
                        (/.set (list $var/0) (/.float dummy/0))
@@ -578,7 +578,7 @@
                 (function (_ $output)
                   (all /.then
                        (/.def $def (list $var/0)
-                         (/.return (/.in? /.locals/0 (/.string (/.code $var/0)))))
+                              (/.return (/.in? /.locals/0 (/.string (/.code $var/0)))))
                        (/.set (list $output) (/.and (/.not (/.in? /.locals/0 (/.string (/.code $var/0))))
                                                     (/.apply (list (/.float dummy/0)) $def)))
                        (/.set (list $var/0) (/.float dummy/0))
@@ -600,9 +600,9 @@
   Test
   (do [! random.monad]
     [expected_error (random.upper_cased 10)
-     expected random.safe_frac
-     dummy (random.only (|>> (f.= expected) not)
-                        random.safe_frac)
+     expected random.safe_dec
+     dummy (random.only (|>> (d.= expected) not)
+                        random.safe_dec)
      $ex (of ! each (|>> %.nat (format "ex_") /.var) random.nat)]
     (all _.and
          (_.coverage [/.raise /.Exception/1]
@@ -625,8 +625,8 @@
                               (list [/.#classes (list "Exception")
                                      /.#exception $ex
                                      /.#handler (/.set (list $output) (/.float expected))]))))
-                    (as Frac)
-                    (f.= expected))
+                    (as Dec)
+                    (d.= expected))
                 (when (try (..statement
                             (function (_ $output)
                               (/.try (all /.then
@@ -752,10 +752,10 @@
   (do [! random.monad]
     [$def (of ! each (|>> %.nat (format "def_") /.var) random.nat)
      $input/0 (of ! each (|>> %.nat (format "input_") /.var) random.nat)
-     expected/0 random.safe_frac
+     expected/0 random.safe_dec
      test random.bit
-     then random.safe_frac
-     else random.safe_frac
+     then random.safe_dec
+     else random.safe_dec
      .let [expected/? (if test then else)]]
     (all _.and
          (_.coverage [/.def /.return]
@@ -763,51 +763,51 @@
                 (function (_ $output)
                   (all /.then
                        (/.def $def (list $input/0)
-                         (/.return $input/0))
+                              (/.return $input/0))
                        (/.set (list $output) (/.apply (list (/.float expected/0)) $def)))))
-               (as Frac)
-               (f.= expected/0)))
+               (as Dec)
+               (d.= expected/0)))
          (_.coverage [/.if]
            (|> (..statement
                 (function (_ $output)
                   (all /.then
                        (/.def $def (list)
-                         (/.if (/.bool test)
-                           (/.return (/.float then))
-                           (/.return (/.float else))))
+                              (/.if (/.bool test)
+                                (/.return (/.float then))
+                                (/.return (/.float else))))
                        (/.set (list $output) (/.apply (list) $def)))))
-               (as Frac)
-               (f.= expected/?)))
+               (as Dec)
+               (d.= expected/?)))
          (_.coverage [/.when /.then]
            (|> (..statement
                 (function (_ $output)
                   (all /.then
                        (/.def $def (list)
-                         (all /.then
-                              (/.when (/.bool test)
-                                (/.return (/.float then)))
-                              (/.return (/.float else))))
+                              (all /.then
+                                   (/.when (/.bool test)
+                                     (/.return (/.float then)))
+                                   (/.return (/.float else))))
                        (/.set (list $output) (/.apply (list) $def)))))
-               (as Frac)
-               (f.= expected/?)))
+               (as Dec)
+               (d.= expected/?)))
          (_.coverage [/.statement]
            (|> (..statement
                 (function (_ $output)
                   (all /.then
                        (/.def $def (list)
-                         (all /.then
-                              (/.statement (/.+ (/.float expected/0) (/.float expected/0)))
-                              (/.return (/.float expected/0))))
+                              (all /.then
+                                   (/.statement (/.+ (/.float expected/0) (/.float expected/0)))
+                                   (/.return (/.float expected/0))))
                        (/.set (list $output) (/.apply (list) $def)))))
-               (as Frac)
-               (f.= expected/0)))
+               (as Dec)
+               (d.= expected/0)))
          (_.coverage [/.exec]
            (|> (..statement
                 (function (_ $output)
                   (/.exec {.#Some /.globals/0}
                     (/.string (/.code (/.set (list $output) (/.float expected/0)))))))
-               (as Frac)
-               (f.= expected/0)))
+               (as Dec)
+               (d.= expected/0)))
          ..test|exception
          (_.for [/.Location]
                 ..test|location)
@@ -819,7 +819,7 @@
   (Random /.Literal)
   (all random.either
        (random#each /.bool random.bit)
-       (random#each /.float random.frac)
+       (random#each /.float random.dec)
        (random#each /.int random.int)
        (random#each /.string (random.lower_cased 1))
        ))
diff --git a/stdlib/source/test/lux/meta/compiler/target/ruby.lux b/stdlib/source/test/lux/meta/compiler/target/ruby.lux
index 8e219b1bed..376afbcf0a 100644
--- a/stdlib/source/test/lux/meta/compiler/target/ruby.lux
+++ b/stdlib/source/test/lux/meta/compiler/target/ruby.lux
@@ -27,7 +27,7 @@
     [number (.only hex)
      ["n" nat]
      ["i" int]
-     ["f" frac]
+     ["d" dec]
      ["[0]" i64]]]
    [meta
     [compiler
@@ -65,7 +65,7 @@
   Test
   (do [! random.monad]
     [bool random.bit
-     float random.frac
+     float random.dec
      int random.int
      string (random.upper_cased 5)]
     (all _.and
@@ -78,7 +78,7 @@
            (expression (|>> (as Int) (i.= int))
                        (/.int int)))
          (_.coverage [/.float]
-           (expression (|>> (as Frac) (f.= float))
+           (expression (|>> (as Dec) (d.= float))
                        (/.float float)))
          (_.coverage [/.string]
            (expression (|>> (as Text) (text#= string))
@@ -111,22 +111,22 @@
 (the test|float
   Test
   (do [! random.monad]
-    [parameter (random.only (|>> (f.= +0.0) not)
-                            random.safe_frac)
-     subject random.safe_frac]
+    [parameter (random.only (|>> (d.= +0.0) not)
+                            random.safe_dec)
+     subject random.safe_dec]
     (`` (all _.and
              (,, (with_template [  
]
                    [(_.coverage []
                       (let [expected ( (
 parameter) (
 subject))]
-                        (expression (|>> (as Frac) (f.= expected))
+                        (expression (|>> (as Dec) (d.= expected))
                                     ( (/.float (
 parameter)) (/.float (
 subject))))))]
 
-                   [/.+ f.+ |>]
-                   [/.- f.- |>]
-                   [/.* f.* |>]
-                   [/./ f./ |>]
-                   [/.% f.mod |>]
-                   [/.pow f.pow f.abs]
+                   [/.+ d.+ |>]
+                   [/.- d.- |>]
+                   [/.* d.* |>]
+                   [/./ d./ |>]
+                   [/.% d.mod |>]
+                   [/.pow d.pow d.abs]
                    ))
              (,, (with_template [ ]
                    [(_.coverage []
@@ -134,11 +134,11 @@
                         (expression (|>> (as Bit) (bit#= expected))
                                     ( (/.float parameter) (/.float subject)))))]
 
-                   [/.<  f.<]
-                   [/.<= f.<=]
-                   [/.>  f.>]
-                   [/.>= f.>=]
-                   [/.=  f.=]
+                   [/.<  d.<]
+                   [/.<= d.<=]
+                   [/.>  d.>]
+                   [/.>= d.>=]
+                   [/.=  d.=]
                    ))
              ))))
 
@@ -158,7 +158,7 @@
              (,, (with_template [ ]
                    [(_.coverage []
                       (let [expected ( left right)]
-                        (expression (|>> (as Frac) f.int (i.= expected))
+                        (expression (|>> (as Dec) d.int (i.= expected))
                                     ( (/.int left) (/.int right)))))]
 
                    [/.bit_or i64.or]
@@ -173,12 +173,12 @@
                            (/.opposite (/.int left))))
              (_.coverage [/.bit_shl]
                (let [expected (i64.left_shifted shift i16)]
-                 (expression (|>> (as Frac) f.int (i.= expected))
+                 (expression (|>> (as Dec) d.int (i.= expected))
                              (/.bit_shl (/.int (.int shift))
                                         (/.int i16)))))
              (_.coverage [/.bit_shr]
                (let [expected (i.right_shifted shift i16)]
-                 (expression (|>> (as Frac) f.int (i.= expected))
+                 (expression (|>> (as Dec) d.int (i.= expected))
                              (/.bit_shr (/.int (.int shift))
                                         (/.int i16)))))
              ))))
@@ -188,17 +188,17 @@
   (do [! random.monad]
     [size (of ! each (|>> (n.% 10) ++) random.nat)
      index (of ! each (n.% size) random.nat)
-     items (random.list size random.safe_frac)
+     items (random.list size random.safe_dec)
      .let [expected (|> items
                         (list.item index)
-                        (maybe.else f.not_a_number))]
+                        (maybe.else d.not_a_number))]
      from (of ! each (n.% size) random.nat)
      plus (of ! each (n.% (n.- from size)) random.nat)
      .let [to (/.int (.int (n.+ plus from)))
            from (/.int (.int from))]]
     (all _.and
          (_.coverage [/.array /.item]
-           (and (expression (|>> (as Frac) (f.= expected))
+           (and (expression (|>> (as Dec) (d.= expected))
                             (/.item (/.int (.int index))
                                     (/.array (list#each /.float items))))
                 (expression (|>> (as Bit))
@@ -215,7 +215,7 @@
 (the test|hash
   Test
   (do [! random.monad]
-    [expected random.safe_frac
+    [expected random.safe_dec
      field (random.upper_cased 5)
      dummy (random.only (|>> (text#= field) not)
                         (random.upper_cased 5))
@@ -223,7 +223,7 @@
            dummy (/.string dummy)]]
     (all _.and
          (_.coverage [/.hash]
-           (and (expression (|>> (as Frac) (f.= expected))
+           (and (expression (|>> (as Dec) (d.= expected))
                             (/.item field (/.hash (list [field (/.float expected)]))))
                 (expression (|>> (as Bit))
                             (|> (/.hash (list [field (/.float expected)]))
@@ -236,7 +236,7 @@
   (do [! random.monad]
     [size (of ! each (|>> (n.% 10) ++) random.nat)
      index (of ! each (n.% size) random.nat)
-     items (random.list size random.safe_frac)
+     items (random.list size random.safe_dec)
      $class (of ! each (|>> %.nat (format "class_") /.local)
                 random.nat)
      $sub_class (of ! each (|>> %.nat (format "sub_class_") /.local)
@@ -250,7 +250,7 @@
                 random.nat)
      $state (of ! each (|>> %.nat (format "instance_") /.instance)
                 random.nat)
-     single random.safe_frac
+     single random.safe_dec
      .let [double (/.function $method/0 (list $arg/0)
                     (/.return (/.+ $arg/0 $arg/0)))]]
     (all _.and
@@ -261,12 +261,12 @@
          (_.coverage [/.do]
            (expression (let [expected (|> items
                                           (list.item index)
-                                          (maybe.else f.not_a_number))]
-                         (|>> (as Frac) (f.= expected)))
+                                          (maybe.else d.not_a_number))]
+                         (|>> (as Dec) (d.= expected)))
                        (|> (/.array (list#each /.float items))
                            (/.do "at" (list (/.int (.int index))) {.#None}))))
          (_.coverage [/.class]
-           (expression (|>> (as Frac) (f.= (f.+ single single)))
+           (expression (|>> (as Dec) (d.= (d.+ single single)))
                        (|> (all /.then
                                 (/.set (list $class) (/.class [/.#parameters (list)
                                                                /.#body double]))
@@ -276,7 +276,7 @@
                            [(list)] (/.lambda {.#None})
                            (/.apply_lambda (list)))))
          (_.coverage [/.new /.initialize]
-           (expression (|>> (as Frac) (f.= single))
+           (expression (|>> (as Dec) (d.= single))
                        (|> (all /.then
                                 (/.set (list $class) (/.class [/.#parameters (list)
                                                                /.#body (all /.then
@@ -291,7 +291,7 @@
                            [(list)] (/.lambda {.#None})
                            (/.apply_lambda (list)))))
          (_.coverage [/.alias_method/2]
-           (expression (|>> (as Frac) (f.= (f.+ single single)))
+           (expression (|>> (as Dec) (d.= (d.+ single single)))
                        (|> (all /.then
                                 (/.set (list $class) (/.class [/.#parameters (list)
                                                                /.#body (all /.then
@@ -306,7 +306,7 @@
          (_.for [/.module]
                 (all _.and
                      (_.coverage [/.include/1]
-                       (expression (|>> (as Frac) (f.= (f.+ single single)))
+                       (expression (|>> (as Dec) (d.= (d.+ single single)))
                                    (|> (all /.then
                                             (/.set (list $class) (/.module [/.#parameters (list)
                                                                             /.#body double]))
@@ -318,7 +318,7 @@
                                        [(list)] (/.lambda {.#None})
                                        (/.apply_lambda (list)))))
                      (_.coverage [/.extend/1]
-                       (expression (|>> (as Frac) (f.= (f.+ single single)))
+                       (expression (|>> (as Dec) (d.= (d.+ single single)))
                                    (|> (all /.then
                                             (/.set (list $class) (/.module [/.#parameters (list)
                                                                             /.#body double]))
@@ -405,11 +405,11 @@
   Test
   (do [! random.monad]
     [test random.bit
-     then random.safe_frac
-     else random.safe_frac
+     then random.safe_dec
+     else random.safe_dec
 
      bool random.bit
-     float random.frac
+     float random.dec
      string (random.upper_cased 5)
 
      comment (random.upper_cased 10)]
@@ -423,12 +423,12 @@
          ..test|io
          (_.coverage [/.?]
            (let [expected (if test then else)]
-             (expression (|>> (as Frac) (f.= expected))
+             (expression (|>> (as Dec) (d.= expected))
                          (/.? (/.bool test)
                               (/.float then)
                               (/.float else)))))
          (_.coverage [/.comment]
-           (expression (|>> (as Frac) (f.= then))
+           (expression (|>> (as Dec) (d.= then))
                        (/.comment comment
                          (/.float then))))
          )))
@@ -436,7 +436,7 @@
 (the test|global
   Test
   (do [! random.monad]
-    [float/0 random.safe_frac
+    [float/0 random.safe_dec
      $global (of ! each /.global (random.lower_cased 10))
      pattern (of ! each /.string (random.lower_cased 11))]
     (all _.and
@@ -490,16 +490,16 @@
 (the test|local_var
   Test
   (do [! random.monad]
-    [float/0 random.safe_frac
+    [float/0 random.safe_dec
      $foreign (of ! each /.local (random.lower_cased 10))]
     (all _.and
          (_.coverage [/.local]
-           (expression (|>> (as Frac) (f.= (f.+ float/0 float/0)))
+           (expression (|>> (as Dec) (d.= (d.+ float/0 float/0)))
                        (|> (/.return (/.+ $foreign $foreign))
                            [(list $foreign)] (/.lambda {.#None})
                            (/.apply_lambda (list (/.float float/0))))))
          (_.coverage [/.set]
-           (expression (|>> (as Frac) (f.= (f.+ float/0 float/0)))
+           (expression (|>> (as Dec) (d.= (d.+ float/0 float/0)))
                        (|> (all /.then
                                 (/.set (list $foreign) (/.float float/0))
                                 (/.return (/.+ $foreign $foreign)))
@@ -510,7 +510,7 @@
 (the test|instance_var
   Test
   (do [! random.monad]
-    [float/0 random.safe_frac
+    [float/0 random.safe_dec
      instance (of ! each (|>> %.nat (format "instance_"))
                   random.nat)
      .let [$instance (/.instance instance)]
@@ -522,7 +522,7 @@
                  random.nat)]
     (all _.and
          (_.coverage [/.instance]
-           (expression (|>> (as Frac) (f.= float/0))
+           (expression (|>> (as Dec) (d.= float/0))
                        (|> (all /.then
                                 (/.set (list $class) (/.class [/.#parameters (list)
                                                                /.#body (all /.then
@@ -537,7 +537,7 @@
                            [(list)] (/.lambda {.#None})
                            (/.apply_lambda (list)))))
          (_.coverage [/.attr_reader/*]
-           (expression (|>> (as Frac) (f.= float/0))
+           (expression (|>> (as Dec) (d.= float/0))
                        (|> (all /.then
                                 (/.set (list $class) (/.class [/.#parameters (list)
                                                                /.#body (all /.then
@@ -551,7 +551,7 @@
                            [(list)] (/.lambda {.#None})
                            (/.apply_lambda (list)))))
          (_.coverage [/.attr_writer/*]
-           (expression (|>> (as Frac) (f.= float/0))
+           (expression (|>> (as Dec) (d.= float/0))
                        (|> (all /.then
                                 (/.set (list $class) (/.class [/.#parameters (list)
                                                                /.#body (all /.then
@@ -567,7 +567,7 @@
                            [(list)] (/.lambda {.#None})
                            (/.apply_lambda (list)))))
          (_.coverage [/.attr_accessor/*]
-           (expression (|>> (as Frac) (f.= float/0))
+           (expression (|>> (as Dec) (d.= float/0))
                        (|> (all /.then
                                 (/.set (list $class) (/.class [/.#parameters (list)
                                                                /.#body (/.attr_accessor/* (list instance))]))
@@ -640,7 +640,7 @@
 (the test|var
   Test
   (do [! random.monad]
-    [float/0 random.safe_frac
+    [float/0 random.safe_dec
      $foreign (of ! each /.local (random.lower_cased 10))
 
      $constant (of ! each /.constant (random.lower_cased 10))]
@@ -677,14 +677,14 @@
 (the test|location
   Test
   (do [! random.monad]
-    [float/0 random.safe_frac
+    [float/0 random.safe_dec
      $foreign (of ! each /.local (random.lower_cased 10))
      field (of ! each /.string (random.upper_cased 10))]
     (all _.and
          (<| (_.for [/.Var])
              ..test|var)
          (_.coverage [/.Access]
-           (and (expression (|>> (as Frac) (f.= (f.+ float/0 float/0)))
+           (and (expression (|>> (as Dec) (d.= (d.+ float/0 float/0)))
                             (let [@ (/.item (/.int +0) $foreign)]
                               (|> (all /.then
                                        (/.set (list $foreign) (/.array (list $foreign)))
@@ -692,7 +692,7 @@
                                        (/.return @))
                                   [(list $foreign)] (/.lambda {.#None})
                                   (/.apply_lambda (list (/.float float/0))))))
-                (expression (|>> (as Frac) (f.= (f.+ float/0 float/0)))
+                (expression (|>> (as Dec) (d.= (d.+ float/0 float/0)))
                             (let [@ (/.item field $foreign)]
                               (|> (all /.then
                                        (/.set (list $foreign) (/.hash (list [field $foreign])))
@@ -706,8 +706,8 @@
 (the test|expression
   Test
   (do [! random.monad]
-    [dummy random.safe_frac
-     expected random.safe_frac]
+    [dummy random.safe_dec
+     expected random.safe_dec]
     (`` (all _.and
              (_.for [/.Literal]
                     ..test|literal)
@@ -735,7 +735,7 @@
     (all _.and
          (_.coverage [/.break]
            (let [expected (i.* (.int expected_inner_iterations) input)]
-             (expression (|>> (as Frac) f.int (i.= expected))
+             (expression (|>> (as Dec) d.int (i.= expected))
                          (|> (all /.then
                                   (/.set (list $inner_index) (/.int +0))
                                   (/.set (list $output) (/.int +0))
@@ -751,7 +751,7 @@
                              (/.apply_lambda (list (/.int input)))))))
          (_.coverage [/.next]
            (let [expected (i.* (.int (n.- expected_inner_iterations full_inner_iterations)) input)]
-             (expression (|>> (as Frac) f.int (i.= expected))
+             (expression (|>> (as Dec) d.int (i.= expected))
                          (|> (all /.then
                                   (/.set (list $inner_index) (/.int +0))
                                   (/.set (list $output) (/.int +0))
@@ -767,7 +767,7 @@
                              (/.apply_lambda (list (/.int input)))))))
          (_.coverage [/.redo]
            (let [expected (i.* (.int (n.- expected_inner_iterations full_inner_iterations)) input)]
-             (expression (|>> (as Frac) f.int (i.= expected))
+             (expression (|>> (as Dec) d.int (i.= expected))
                          (|> (all /.then
                                   (/.set (list $inner_index) (/.int +0))
                                   (/.set (list $output) (/.int +0))
@@ -826,9 +826,9 @@
 (the test|exception
   Test
   (do [! random.monad]
-    [expected random.safe_frac
-     dummy (random.only (|>> (f.= expected) not)
-                        random.safe_frac)
+    [expected random.safe_dec
+     dummy (random.only (|>> (d.= expected) not)
+                        random.safe_dec)
      error (random.lower_cased 10)
      $ex (of ! each /.local (random.lower_cased 10))
 
@@ -839,13 +839,13 @@
            dummy_tag (/.int dummy_tag)]]
     (all _.and
          (_.coverage [/.begin]
-           (expression (|>> (as Frac) (f.= expected))
+           (expression (|>> (as Dec) (d.= expected))
                        (|> (/.begin (/.return (/.float expected))
                                     (list [(list) $ex (/.return (/.float dummy))]))
                            [(list)] (/.lambda {.#None})
                            (/.apply_lambda (list)))))
          (_.coverage [/.Rescue /.throw/1]
-           (expression (|>> (as Frac) (f.= expected))
+           (expression (|>> (as Dec) (d.= expected))
                        (|> (/.begin (all /.then
                                          (/.throw/1 (/.string error))
                                          (/.return (/.float dummy)))
@@ -853,7 +853,7 @@
                            [(list)] (/.lambda {.#None})
                            (/.apply_lambda (list)))))
          (_.coverage [/.raise]
-           (expression (|>> (as Frac) (f.= expected))
+           (expression (|>> (as Dec) (d.= expected))
                        (|> (/.begin (all /.then
                                          (/.statement (/.raise (/.string error)))
                                          (/.return (/.float dummy)))
@@ -861,20 +861,20 @@
                            [(list)] (/.lambda {.#None})
                            (/.apply_lambda (list)))))
          (_.coverage [/.catch /.throw/2]
-           (and (expression (|>> (as Frac) (f.= expected))
+           (and (expression (|>> (as Dec) (d.= expected))
                             (<| (/.apply_lambda (list))
                                 (/.lambda {.#None}) [(list)]
                                 /.return
                                 (/.catch expected_tag) [(list)]
                                 (/.throw/2 expected_tag (/.float expected))))
-                (expression (|>> (as Frac) (f.= expected))
+                (expression (|>> (as Dec) (d.= expected))
                             (<| (/.apply_lambda (list))
                                 (/.lambda {.#None}) [(list)]
                                 /.return
                                 (/.catch expected_tag) [(list)]
                                 /.statement (/.catch dummy_tag) [(list)]
                                 (/.throw/2 expected_tag (/.float expected))))
-                (expression (|>> (as Frac) (f.= expected))
+                (expression (|>> (as Dec) (d.= expected))
                             (<| (/.apply_lambda (list))
                                 (/.lambda {.#None}) [(list)]
                                 /.return
@@ -913,31 +913,31 @@
      field (random.lower_cased 3)
      $class (of ! each /.local (random.upper_cased 4))
 
-     float/0 random.safe_frac
-     float/1 random.safe_frac
-     float/2 random.safe_frac
+     float/0 random.safe_dec
+     float/1 random.safe_dec
+     float/2 random.safe_dec
      $arg/0 (of ! each /.local (random.lower_cased 10))
      $arg/1 (of ! each /.local (random.lower_cased 11))
      $arg/2 (of ! each /.local (random.lower_cased 12))]
     (all _.and
          (_.coverage [/.lambda /.return]
-           (and (expression (|>> (as Frac) (f.= float/0))
+           (and (expression (|>> (as Dec) (d.= float/0))
                             (|> (/.return (/.float float/0))
                                 [(list)] (/.lambda {.#None})
                                 (/.apply_lambda (list))))
-                (expression (|>> (as Frac) f.nat (n.= iterations))
+                (expression (|>> (as Dec) d.nat (n.= iterations))
                             (|> (/.return (/.? (/.< (/.int (.int iterations)) $arg/0)
                                                (/.apply_lambda (list (/.+ (/.int +1) $arg/0)) $self)
                                                $arg/0))
                                 [(list $arg/0)] (/.lambda {.#Some $self})
                                 (/.apply_lambda (list (/.int +0)))))))
          (_.coverage [/.apply_lambda]
-           (expression (|>> (as Frac) (f.= (all f.+ float/0 float/1 float/2)))
+           (expression (|>> (as Dec) (d.= (all d.+ float/0 float/1 float/2)))
                        (|> (/.return (all /.+ $arg/0 $arg/1 $arg/2))
                            [(list $arg/0 $arg/1 $arg/2)] (/.lambda {.#None})
                            (/.apply_lambda (list (/.float float/0) (/.float float/1) (/.float float/2))))))
          (_.coverage [/.function]
-           (expression (|>> (as Frac) f.nat (n.= iterations))
+           (expression (|>> (as Dec) d.nat (n.= iterations))
                        (|> (all /.then
                                 (/.function $self (list $arg/0)
                                   (/.return (/.? (/.< (/.int (.int iterations)) $arg/0)
@@ -947,7 +947,7 @@
                            [(list)] (/.lambda {.#None})
                            (/.apply_lambda (list)))))
          (_.coverage [/.apply]
-           (expression (|>> (as Frac) (f.= (all f.+ float/0 float/1 float/2)))
+           (expression (|>> (as Dec) (d.= (all d.+ float/0 float/1 float/2)))
                        (|> (all /.then
                                 (/.function $self (list $arg/0 $arg/1 $arg/2)
                                   (/.return (all /.+ $arg/0 $arg/1 $arg/2)))
@@ -959,9 +959,9 @@
 (the test|branching
   Test
   (do [! random.monad]
-    [float/0 random.safe_frac
-     float/1 random.safe_frac
-     float/2 random.safe_frac
+    [float/0 random.safe_dec
+     float/1 random.safe_dec
+     float/2 random.safe_dec
      arg/0 (random.lower_cased 10)
      arg/1 (random.only (|>> (text#= arg/0) not)
                         (random.lower_cased 10))
@@ -974,14 +974,14 @@
      ??? random.bit]
     (all _.and
          (_.coverage [/.if]
-           (expression (|>> (as Frac) (f.= (if ??? float/0 float/1)))
+           (expression (|>> (as Dec) (d.= (if ??? float/0 float/1)))
                        (|> (/.if (/.bool ???)
                              (/.return (/.float float/0))
                              (/.return (/.float float/1)))
                            [(list)] (/.lambda {.#None})
                            (/.apply_lambda (list)))))
          (_.coverage [/.when]
-           (expression (|>> (as Frac) (f.= (if ??? float/0 float/1)))
+           (expression (|>> (as Dec) (d.= (if ??? float/0 float/1)))
                        (|> (all /.then
                                 (/.when (/.bool ???)
                                   (/.return (/.float float/0)))
@@ -993,9 +993,9 @@
 (the test|statement
   Test
   (do [! random.monad]
-    [float/0 random.safe_frac
-     float/1 random.safe_frac
-     float/2 random.safe_frac
+    [float/0 random.safe_dec
+     float/1 random.safe_dec
+     float/2 random.safe_dec
      $arg/0 (of ! each /.local (random.lower_cased 10))
      $arg/1 (of ! each /.local (random.lower_cased 11))
      $arg/2 (of ! each /.local (random.lower_cased 12))
@@ -1003,14 +1003,14 @@
                   random.int)]
     (all _.and
          (_.coverage [/.statement]
-           (expression (|>> (as Frac) (f.= float/0))
+           (expression (|>> (as Dec) (d.= float/0))
                        (|> (all /.then
                                 (/.statement (/.+ $arg/0 $arg/0))
                                 (/.return $arg/0))
                            [(list $arg/0)] (/.lambda {.#None})
                            (/.apply_lambda (list (/.float float/0))))))
          (_.coverage [/.then]
-           (expression (|>> (as Frac) (f.= float/0))
+           (expression (|>> (as Dec) (d.= float/0))
                        (|> (all /.then
                                 (/.return $arg/0)
                                 (/.return $arg/1))
@@ -1037,7 +1037,7 @@
   (let [literal (is (Random /.Literal)
                     (all random.either
                          (random#each /.bool random.bit)
-                         (random#each /.float random.frac)
+                         (random#each /.float random.dec)
                          (random#each /.int random.int)
                          (random#each /.string (random.lower_cased 5))
                          ))]
diff --git a/stdlib/source/test/lux/meta/macro/pattern.lux b/stdlib/source/test/lux/meta/macro/pattern.lux
index 0cf16c6325..50841973b8 100644
--- a/stdlib/source/test/lux/meta/macro/pattern.lux
+++ b/stdlib/source/test/lux/meta/macro/pattern.lux
@@ -13,7 +13,7 @@
     [number
      ["n" nat]
      ["i" int]
-     ["f" frac]]]
+     ["d" dec]]]
    [meta
     ["[0]" code]]
    [test
@@ -39,8 +39,8 @@
          expected_int (of ! each (i.% +1) random.int)
          expected_rev (random.either (in .5)
                                      (in .25))
-         expected_frac (random.either (in +0.5)
-                                      (in +1.25))
+         expected_dec (random.either (in +0.5)
+                                     (in +1.25))
          expected_text (random.either (in "+0.5")
                                       (in "+1.25"))])
       (_.for [.Pattern
@@ -60,7 +60,7 @@
              (and (/.when expected_rev
                     (/.or .5 .25) true
                     _ false)
-                  (/.when expected_frac
+                  (/.when expected_dec
                     (/.or +0.5 +1.25) true
                     _ false)
                   (/.when expected_text
@@ -93,10 +93,10 @@
                       _
                       false))))
            (_.coverage [/.|>]
-             (when expected_frac
-               (/.|> actual_frac [(f.* +2.0) (f.* +2.0)])
-               (f.= (f.* +4.0 expected_frac)
-                    actual_frac)))
+             (when expected_dec
+               (/.|> actual_dec [(d.* +2.0) (d.* +2.0)])
+               (d.= (d.* +4.0 expected_dec)
+                    actual_dec)))
            (_.coverage [/.`]
              (when (code.text expected_text)
                (/.` "+0.5") true
diff --git a/stdlib/source/test/lux/meta/static.lux b/stdlib/source/test/lux/meta/static.lux
index 893bcd01a3..1a77809624 100644
--- a/stdlib/source/test/lux/meta/static.lux
+++ b/stdlib/source/test/lux/meta/static.lux
@@ -16,7 +16,7 @@
      ["n" nat]
      ["i" int]
      ["r" rev]
-     ["f" frac]]]
+     ["d" dec]]]
    ["[0]" meta (.only)
     ["[0]" code]]
    [test
@@ -47,17 +47,17 @@
                      [/.int /.random_int i.= i.+ .#Int]
                      [/.rev /.random_rev r.= r.+ .#Rev]
                      ))
-               (_.coverage [/.frac /.random_frac]
-                 (with_expansions [ (/.random_frac)
-                                    (/.random_frac)
-                                    (/.frac (f.+  ))]
+               (_.coverage [/.dec /.random_dec]
+                 (with_expansions [ (/.random_dec)
+                                    (/.random_dec)
+                                    (/.dec (d.+  ))]
                    (when (' )
-                     [_ {.#Frac l+r}]
-                     (or (f.= l+r (f.+  ))
-                         (and (f.not_a_number? l+r)
-                              (f.not_a_number? (f.+  ))
-                              (or (f.not_a_number? )
-                                  (f.not_a_number? ))))
+                     [_ {.#Dec l+r}]
+                     (or (d.= l+r (d.+  ))
+                         (and (d.not_a_number? l+r)
+                              (d.not_a_number? (d.+  ))
+                              (or (d.not_a_number? )
+                                  (d.not_a_number? ))))
 
                      _
                      false)))
@@ -105,7 +105,7 @@
                  (with_expansions [ (/.random_bit)
                                     (/.random_nat)
                                     (/.random_nat)
-                                    (/.random_frac)]
+                                    (/.random_dec)]
                    (n.= (if   )
                         (/.cond  
                                 (not ) 
diff --git a/stdlib/source/test/lux/meta/type.lux b/stdlib/source/test/lux/meta/type.lux
index 91a309f48b..79354f951d 100644
--- a/stdlib/source/test/lux/meta/type.lux
+++ b/stdlib/source/test/lux/meta/type.lux
@@ -584,7 +584,7 @@
                                                                     (random#in Nat)
                                                                     (random#in Int)
                                                                     (random#in Rev)
-                                                                    (random#in Frac)
+                                                                    (random#in Dec)
                                                                     (random#in Rev))))
                              parameter random_type
                              return random_type
diff --git a/stdlib/source/test/lux/meta/type/object.lux b/stdlib/source/test/lux/meta/type/object.lux
index 6419284dba..9b909265bb 100644
--- a/stdlib/source/test/lux/meta/type/object.lux
+++ b/stdlib/source/test/lux/meta/type/object.lux
@@ -14,7 +14,7 @@
     ["[0]" random (.only Random)]
     [number
      ["n" nat]
-     ["f" frac]]
+     ["d" dec]]
     [geometry
      ["[0]" circle]]]
    [test
@@ -24,55 +24,55 @@
  ["[0]" \\parser])
 
 (/.every (Shape [] _)
-  [#perimeter (/.Method [] Frac)
-   #area (/.Method [] Frac)])
+  [#perimeter (/.Method [] Dec)
+   #area (/.Method [] Dec)])
 
 (every Circle
   (Record
-   [#radius Frac]))
+   [#radius Dec]))
 
 (the circle
   (Shape Circle)
   [#perimeter (/.method
                 (function (_ next again [this _])
-                  (all f.* +2.0 circle.pi (its #radius (/.state this)))))
+                  (all d.* +2.0 circle.pi (its #radius (/.state this)))))
    #area (/.method
            (function (_ next again [this _])
              (let [radius (its #radius (/.state this))]
-               (all f.* circle.pi radius radius))))])
+               (all d.* circle.pi radius radius))))])
 
 (every Square
   (Record
-   [#side Frac]))
+   [#side Dec]))
 
 (the square
   (Shape Square)
   [#perimeter (/.method
                 (function (_ next again [this _])
-                  (all f.* +4.0 (its #side (/.state this)))))
+                  (all d.* +4.0 (its #side (/.state this)))))
    #area (/.method
            (function (_ next again [this _])
              (let [side (its #side (/.state this))]
-               (all f.* side side))))])
+               (all d.* side side))))])
 
 (the (scaled scalar)
-  (-> Frac (Shape Frac)
-      (Shape Frac))
+  (-> Dec (Shape Dec)
+      (Shape Dec))
   (|>> (/.override #perimeter
                    (function (_ next again [this input])
-                     (all f.*
+                     (all d.*
                           scalar
                           (next [this input]))))
        (/.override #area
                    (function (_ next again [this input])
-                     (all f.*
+                     (all d.*
                           scalar scalar
                           (next [this input]))))))
 
 (the value
-  (Random Frac)
+  (Random Dec)
   (of random.functor each
-      (|>> (n.% 100) n.frac)
+      (|>> (n.% 100) n.dec)
       random.nat))
 
 (the \\parser
@@ -84,7 +84,7 @@
          side ..value])
       (all _.and
            (_.coverage [\\parser.any \\parser.value]
-             (when (\\parser.value (is (\\parser.Parser Shape Frac)
+             (when (\\parser.value (is (\\parser.Parser Shape Dec)
                                        (do parser.monad
                                          [it (\\parser.any ..circle)]
                                          (in (/.state it))))
@@ -95,7 +95,7 @@
                {try.#Failure _}
                false))
            (_.coverage [\\parser.wrong_class]
-             (when (\\parser.value (is (\\parser.Parser Shape Frac)
+             (when (\\parser.value (is (\\parser.Parser Shape Dec)
                                        (do parser.monad
                                          [it (\\parser.any ..circle)]
                                          (in (/.state it))))
@@ -139,12 +139,12 @@
                         /.method /.on]
              (let [it (is (/.Object Shape Circle)
                           (/.object circle [#radius radius]))]
-               (not (f.= (/.on #perimeter [] it)
+               (not (d.= (/.on #perimeter [] it)
                          (/.on #area [] it)))))
            (_.coverage [/.override]
-             (and (f.= (/.on #perimeter [] (/.object ..square [#radius (f.* scale radius)]))
+             (and (d.= (/.on #perimeter [] (/.object ..square [#radius (d.* scale radius)]))
                        (/.on #perimeter [] (/.object (..scaled scale ..square) [#radius radius])))
-                  (f.= (/.on #area [] (/.object ..square [#radius (f.* scale radius)]))
+                  (d.= (/.on #area [] (/.object ..square [#radius (d.* scale radius)]))
                        (/.on #area [] (/.object (..scaled scale ..square) [#radius radius])))))
 
            ..\\parser
diff --git a/stdlib/source/test/lux/test/benchmark.lux b/stdlib/source/test/lux/test/benchmark.lux
index ed1f5c8632..2adbaaee94 100644
--- a/stdlib/source/test/lux/test/benchmark.lux
+++ b/stdlib/source/test/lux/test/benchmark.lux
@@ -12,8 +12,7 @@
    [math
     ["[0]" random (.only Random)]
     [number
-     ["n" nat]
-     ["f" frac]]]
+     ["n" nat]]]
    [world
     [time
      ["[0]" duration]]]
diff --git a/stdlib/source/test/lux/web/html/attribute/source.lux b/stdlib/source/test/lux/web/html/attribute/source.lux
index feb5dee51a..0bac830a78 100644
--- a/stdlib/source/test/lux/web/html/attribute/source.lux
+++ b/stdlib/source/test/lux/web/html/attribute/source.lux
@@ -27,7 +27,7 @@
       (do [! random.monad]
         [url (random.lower_cased 5)
          width random.nat
-         density random.frac])
+         density random.dec])
       (_.for [/.Source
               /.source])
       (all _.and
@@ -38,5 +38,5 @@
            (_.coverage [/.by_density]
              (let [source (/.source (/.by_density density url))]
                (and (text.contains? url source)
-                    (text.contains? (%.frac density) source))))
+                    (text.contains? (%.dec density) source))))
            )))
diff --git a/stdlib/source/test/lux/world/finance/interest/rate.lux b/stdlib/source/test/lux/world/finance/interest/rate.lux
index 6817f124d9..0966be2e84 100644
--- a/stdlib/source/test/lux/world/finance/interest/rate.lux
+++ b/stdlib/source/test/lux/world/finance/interest/rate.lux
@@ -15,7 +15,7 @@
     ["[0]" random (.only Random) (.use "[1]#[0]" functor)]
     [number
      ["n" nat]
-     ["f" frac]]]
+     ["d" dec]]]
    [test
     ["_" property (.only Test)]]]]
  [\\library
@@ -30,11 +30,11 @@
     [.let [max 100]
      it (of ! each (n.% (++ max)) random.nat)
      gain? random.bit
-     .let [it (f./ (n.frac max)
-                   (n.frac it))]]
+     .let [it (d./ (n.dec max)
+                   (n.dec it))]]
     (in (if gain?
-          (f.+ it /.break_even)
-          (f.- it /.break_even)))))
+          (d.+ it /.break_even)
+          (d.- it /.break_even)))))
 
 (the .public test
   Test
@@ -47,12 +47,12 @@
       (_.for [/.Rate])
       (all _.and
            (_.for [/.monoid /.break_even /.compound]
-                  (monoidT.spec (f.approximately? +0.000000000000001)
+                  (monoidT.spec (d.approximately? +0.000000000000001)
                                 /.monoid
                                 ..random))
            
            (_.coverage [/.format]
-             (bit#= (f.= left right)
+             (bit#= (d.= left right)
                     (text#= (/.format left) (/.format right))))
            (_.coverage [/.loss? /.gain? /.break_even?]
              (or (and (/.loss? left)
diff --git a/stdlib/source/test/lux/world/finance/market/analysis/accumulation_distribution.lux b/stdlib/source/test/lux/world/finance/market/analysis/accumulation_distribution.lux
index ae2f3d37d9..427549a225 100644
--- a/stdlib/source/test/lux/world/finance/market/analysis/accumulation_distribution.lux
+++ b/stdlib/source/test/lux/world/finance/market/analysis/accumulation_distribution.lux
@@ -9,7 +9,7 @@
    [math
     ["[0]" random (.only Random)]
     [number
-     ["f" frac]]]
+     ["d" dec]]]
    [test
     ["_" property (.only Test)]]]]
  [\\library
@@ -29,6 +29,6 @@
       (all _.and
            (_.coverage [/.oscillation]
              (let [it (/.oscillation session)]
-               (and (f.<= +1.0 it)
-                    (f.>= -1.0 it))))
+               (and (d.<= +1.0 it)
+                    (d.>= -1.0 it))))
            )))
diff --git a/stdlib/source/test/lux/world/time/series/average.lux b/stdlib/source/test/lux/world/time/series/average.lux
index 0065174fc2..887e865752 100644
--- a/stdlib/source/test/lux/world/time/series/average.lux
+++ b/stdlib/source/test/lux/world/time/series/average.lux
@@ -13,7 +13,7 @@
     ["[0]" random (.only Random)]
     [number
      ["n" nat]
-     ["f" frac]
+     ["d" dec]
      ["[0]" i64]]]
    [world
     [time
@@ -27,7 +27,7 @@
 
 (the (series events)
   (-> Nat
-      (Random (/.Series Frac)))
+      (Random (/.Series Dec)))
   (do [! random.monad]
     [.let [duration (random.only duration.positive? random.duration)]
      offset (of ! each (duration.framed (duration.up 100 duration.normal_year))
@@ -35,7 +35,7 @@
      .let [start (instant.after offset instant.epoch)]
      interval (of ! each (duration.framed duration.week)
                   duration)
-     data (random.sequence events random.safe_frac)]
+     data (random.sequence events random.safe_dec)]
     (in [//.#start start
          //.#interval interval
          //.#data data])))
@@ -92,9 +92,9 @@
                       (let [exponential (/.exponential /.simple_factor input)
                             simple (/.simple input)
                             weighted (/.weighted input)]
-                        (and (not (f.= exponential simple))
-                             (not (f.= exponential weighted))
-                             (not (f.= simple weighted)))))
+                        (and (not (d.= exponential simple))
+                             (not (d.= exponential weighted))
+                             (not (d.= simple weighted)))))
                     (_.coverage [/.moving]
                       (<| (try.else false)
                           (do try.monad
@@ -107,7 +107,7 @@
                              weighted (/.moving /.weighted
                                                 additional
                                                 input)
-                             .let [(open "//#[0]") (//.equivalence f.equivalence)
+                             .let [(open "//#[0]") (//.equivalence d.equivalence)
 
                                    all_are_well_windowed!
                                    (and (well_windowed? input additional exponential)
diff --git a/stdlib/source/unsafe/lux/data/binary.lux b/stdlib/source/unsafe/lux/data/binary.lux
index 498a1a1451..8ddf7e3967 100644
--- a/stdlib/source/unsafe/lux/data/binary.lux
+++ b/stdlib/source/unsafe/lux/data/binary.lux
@@ -101,7 +101,7 @@
                       (,, (.static .js))
                       (.|> 
                            (.js_object_get# "length")
-                           (.as .Frac)
+                           (.as .Dec)
                            .f64_int#
                            .nat)
 
@@ -137,9 +137,9 @@
 
                       (,, (.static .js))
                       (.|> 
-                           (.as (array.Array .Frac))
+                           (.as (array.Array .Dec))
                            (.js_array_read# )
-                           (.as .Frac)
+                           (.as .Dec)
                            .f64_int#
                            .i64)
 
@@ -216,7 +216,7 @@
                       (,, (.static .js))
                       (.|> 
                            (.is ..Binary)
-                           (.as (array.Array .Frac))
+                           (.as (array.Array .Dec))
                            (.js_array_write# 
                                              (.|> 
                                                   .int
diff --git a/to_do.md b/to_do.md
index 2107c45996..9decb57e9c 100644
--- a/to_do.md
+++ b/to_do.md
@@ -16,7 +16,6 @@
 0. Re-name `Codec#format` to `injection` and `Codec#value` to `projection`.
 0. Re-name `Codec` to `Embedding`.
    * [Embedding](https://en.wikipedia.org/wiki/Embedding)
-0. Implement polytypic counting/length via induction.
 0. Re-name `Format` to `Injection`.
 0. Re-name `Parser` to `Projection`.
 0. `<-` as reverse-order function syntax.
@@ -24,8 +23,7 @@
    * [Mathematicians Use Numbers Differently From The Rest of Us](https://www.youtube.com/watch?v=tRaq4aYPzCc)
    * [Fractions and p-adic numbers | Real numbers and limits Math Foundations 90 | N J Wildberger](https://www.youtube.com/watch?v=XXRwlo_MHnI)
 0. Get rid of `#Sum`, `#Product`, and `#Function` types in `Type`, and replace them with custom-named instances of Nominal.
-0. Re-name Frac(tion) to Dec(imal). Re-name Ratio to Frac(tion). Then, introduce an integer-based alternative to Frac(tion) called Rat(tional).
-   * [Decimal](https://en.wikipedia.org/wiki/Decimal)
+0. Re-name Ratio to Frac(tion). Then, introduce an integer-based alternative to Frac(tion) called Rat(tional).
    * [Fraction](https://en.wikipedia.org/wiki/Fraction)
 0. Have alternative arithmetic operators for Frac(tion) that do not normalize the result after the operation (+', -', *', /').
    * Normalization would obfuscate [an interesting fact about working with infinity](https://youtu.be/pE01mIrsw74?list=PL5A714C94D40392AB&t=1010).
@@ -37,13 +35,17 @@
    * The above rule can make `a/0 * 0/b = a/b` and `0/a * b/0 = b/a`, bypassing any possibility for `0/0`.
    * It may also make the de-normalized zeroes and infinities carry useful information, instead of losing it through normalization.
 0. Extract the variable link-ring machinery being used by both the `control/logic` and `meta/type/check` modules into its own module.
-0. Re-name `check.subsumes?` to `check.subsumed?`.
 0. Replace recursive type calls from `(0 "")` to `(0 0)`
 0. Fix bug wherein private aliases in module `A` of public definitions in module `B` are seen in module `C`, if it imports `A`.
+0. Re-name `check.subsumes?` to `check.subsumed?`.
+0. Get rid of `Dec` encoding/decoding default extensions.
 
 ## Done
 
-0. Re-implement all the current polytypic code just using induction.
+0. Re-name Frac(tion) to Dec(imal).
+   * [Decimal](https://en.wikipedia.org/wiki/Decimal)
+0. Implement polytypic counting/length via induction.
+0. [(Commit)](https://github.com/LuxLang/lux/commit/9b6682b709a5ce3d00b696dadb60d56c869edbf2) Re-implement all the current polytypic code just using induction.
    * [(Commit)](https://github.com/LuxLang/lux/commit/403d5a46c8cbada8e6eb5d457a98b1e8d9df87f3)
    * [(Commit)](https://github.com/LuxLang/lux/commit/caab080b72a358b63d6a289e0bf6e929d00873fb)
 0. [(Commit)](https://github.com/LuxLang/lux/commit/caab080b72a358b63d6a289e0bf6e929d00873fb) Allow for an alternative syntax for anonymous Variant/Sum construction where just a statically-known bit and a term are provided.