aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/data/number.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/lux/data/number.lux44
1 files changed, 22 insertions, 22 deletions
diff --git a/stdlib/source/lux/data/number.lux b/stdlib/source/lux/data/number.lux
index efd965d1b..b133e905f 100644
--- a/stdlib/source/lux/data/number.lux
+++ b/stdlib/source/lux/data/number.lux
@@ -172,7 +172,7 @@
(#error.Success value)
#.None
- (#error.Error <error>))))]
+ (#error.Failure <error>))))]
[Frac "lux frac encode" "lux frac decode" "Could not decode Frac"]
)
@@ -316,13 +316,13 @@
(if (n/< input-size idx)
(case (<to-value> (get-char! repr idx))
#.None
- (#error.Error ("lux text concat" <error> repr))
+ (#error.Failure ("lux text concat" <error> repr))
(#.Some digit-value)
(recur (inc idx)
(|> output (n/* <base>) (n/+ digit-value))))
(#error.Success output)))
- (#error.Error ("lux text concat" <error> repr))))))]
+ (#error.Failure ("lux text concat" <error> repr))))))]
[Binary@Codec<Text,Nat> 2 binary-character binary-value "Invalid binary syntax for Nat: "]
[Octal@Codec<Text,Nat> 8 octal-character octal-value "Invalid octal syntax for Nat: "]
@@ -355,7 +355,7 @@
(if (n/< input-size idx)
(case (<to-value> (get-char! repr idx))
#.None
- (#error.Error <error>)
+ (#error.Failure <error>)
(#.Some digit-value)
(recur (inc idx)
@@ -385,8 +385,8 @@
(int-decode-loop input-size repr sign <base> <to-value> <error>)
#.None
- (#error.Error <error>))
- (#error.Error <error>)))))]
+ (#error.Failure <error>))
+ (#error.Failure <error>)))))]
[Binary@Codec<Text,Int> +2 binary-character binary-value "Invalid binary syntax for Int: "]
[Octal@Codec<Text,Int> +8 octal-character octal-value "Invalid octal syntax for Int: "]
@@ -399,7 +399,7 @@
("lux text clip" input 1 ("lux text size" input)))
(do-template [<struct> <nat> <char-bit-size> <error>]
- [(with-expansions [<error-output> (as-is (#error.Error ("lux text concat" <error> repr)))]
+ [(with-expansions [<error-output> (as-is (#error.Failure ("lux text concat" <error> repr)))]
(structure: #export <struct> (Codec Text Rev)
(def: (encode value)
(let [raw-output (de-prefix (:: <nat> encode (:coerce Nat value)))
@@ -476,16 +476,16 @@
(#error.Success dec-rev)
dec-rev
- (#error.Error error)
+ (#error.Failure error)
(error! error))]
(#error.Success (f/+ (int-to-frac whole)
(f/* sign adjusted-decimal))))
_
- (#error.Error ("lux text concat" <error> repr))))
+ (#error.Failure ("lux text concat" <error> repr))))
_
- (#error.Error ("lux text concat" <error> repr)))))]
+ (#error.Failure ("lux text concat" <error> repr)))))]
[Binary@Codec<Text,Frac> Binary@Codec<Text,Int> +2.0 "01" "Invalid binary syntax: "]
)
@@ -656,14 +656,14 @@
("lux text concat" (<to> whole-part))
("lux text concat" (if (f/= -1.0 sign) "-" "+")))]
(case (:: Binary@Codec<Text,Frac> decode as-binary)
- (#error.Error _)
- (#error.Error ("lux text concat" <error> repr))
+ (#error.Failure _)
+ (#error.Failure ("lux text concat" <error> repr))
output
output))
_
- (#error.Error ("lux text concat" <error> repr))))))]
+ (#error.Failure ("lux text concat" <error> repr))))))]
[Octal@Codec<Text,Frac> "Invalid octaladecimal syntax: " binary-to-octal octal-to-binary]
[Hex@Codec<Text,Frac> "Invalid hexadecimal syntax: " binary-to-hex hex-to-binary]
@@ -683,7 +683,7 @@
(~ example-2))))]))
_
- (#error.Error "Wrong syntax for 'encoding-doc'.")))
+ (#error.Failure "Wrong syntax for 'encoding-doc'.")))
(def: (underscore-prefixed? number)
(-> Text Bit)
@@ -704,29 +704,29 @@
(case tokens
(#.Cons [meta (#.Text repr')] #.Nil)
(if (underscore-prefixed? repr')
- (#error.Error <error>)
+ (#error.Failure <error>)
(let [repr (clean-underscores repr')]
(case (:: <nat> decode repr)
(#error.Success value)
(#error.Success [state (list [meta (#.Nat value)])])
- (^multi (#error.Error _)
+ (^multi (#error.Failure _)
[(:: <int> decode repr) (#error.Success value)])
(#error.Success [state (list [meta (#.Int value)])])
- (^multi (#error.Error _)
+ (^multi (#error.Failure _)
[(:: <rev> decode repr) (#error.Success value)])
(#error.Success [state (list [meta (#.Rev value)])])
- (^multi (#error.Error _)
+ (^multi (#error.Failure _)
[(:: <frac> decode repr) (#error.Success value)])
(#error.Success [state (list [meta (#.Frac value)])])
_
- (#error.Error <error>))))
+ (#error.Failure <error>))))
_
- (#error.Error <error>)))]
+ (#error.Failure <error>)))]
[bin Binary@Codec<Text,Nat> Binary@Codec<Text,Int> Binary@Codec<Text,Rev> Binary@Codec<Text,Frac>
"Invalid binary syntax."
@@ -918,8 +918,8 @@
(#error.Success (:coerce Rev output))))
#.None
- (#error.Error ("lux text concat" "Wrong syntax for Rev: " input)))
- (#error.Error ("lux text concat" "Wrong syntax for Rev: " input))))
+ (#error.Failure ("lux text concat" "Wrong syntax for Rev: " input)))
+ (#error.Failure ("lux text concat" "Wrong syntax for Rev: " input))))
))
(def: (log2 input)