diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/library/lux/math/number/frac.lux | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/stdlib/source/library/lux/math/number/frac.lux b/stdlib/source/library/lux/math/number/frac.lux index ac528ad6d..d3cd5f138 100644 --- a/stdlib/source/library/lux/math/number/frac.lux +++ b/stdlib/source/library/lux/math/number/frac.lux @@ -14,7 +14,9 @@ ["[0]" maybe] ["[0]" try {"+" Try}]] [data - ["[0]" text]]]] + ["[0]" text]] + [macro + ["^" pattern]]]] ["[0]" // "_" ["[1][0]" i64] ["[1][0]" nat] @@ -308,13 +310,13 @@ (case [(: Nat (..exponent it)) (: Nat (..mantissa it)) (: Nat (..sign it))] - (^ [(static ..special_exponent_bits) 0 0]) + (pattern [(static ..special_exponent_bits) 0 0]) ..positive_infinity - (^ [(static ..special_exponent_bits) 0 1]) + (pattern [(static ..special_exponent_bits) 0 1]) ..negative_infinity - (^ [(static ..special_exponent_bits) _ _]) + (pattern [(static ..special_exponent_bits) _ _]) ..not_a_number ... Positive zero @@ -348,7 +350,7 @@ ("lux text index" 0 "E+" representation) ("lux text index" 0 "e-" representation) ("lux text index" 0 "E-" representation)] - (^template [<factor> <patterns>] + (^.template [<factor> <patterns>] [<patterns> (do try.monad [.let [after_offset (//nat.+ 2 split_index) @@ -358,10 +360,10 @@ (# codec decoded))] (in [("lux text clip" 0 split_index representation) (//int.* <factor> (.int exponent))]))]) - ([+1 (^or [{.#Some split_index} {.#None} {.#None} {.#None}] - [{.#None} {.#Some split_index} {.#None} {.#None}])] - [-1 (^or [{.#None} {.#None} {.#Some split_index} {.#None}] - [{.#None} {.#None} {.#None} {.#Some split_index}])]) + ([+1 (^.or [{.#Some split_index} {.#None} {.#None} {.#None}] + [{.#None} {.#Some split_index} {.#None} {.#None}])] + [-1 (^.or [{.#None} {.#None} {.#Some split_index} {.#None}] + [{.#None} {.#None} {.#None} {.#Some split_index}])]) _ {try.#Success [representation +0]})) |