aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/data/text/encoding.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/lux/data/text/encoding.lux')
-rw-r--r--stdlib/source/lux/data/text/encoding.lux15
1 files changed, 8 insertions, 7 deletions
diff --git a/stdlib/source/lux/data/text/encoding.lux b/stdlib/source/lux/data/text/encoding.lux
index fca1e7632..59e5efcc2 100644
--- a/stdlib/source/lux/data/text/encoding.lux
+++ b/stdlib/source/lux/data/text/encoding.lux
@@ -3,9 +3,10 @@
["@" target]
[abstract
[codec (#+ Codec)]]
+ [control
+ ["." try (#+ Try)]]
[data
- [binary (#+ Binary)]
- ["." error (#+ Error)]]
+ [binary (#+ Binary)]]
[type
abstract]
["." host]])
@@ -207,16 +208,16 @@
(TextEncoder::encode [value]))})))
(def: #export (from-utf8 value)
- (-> Binary (Error Text))
+ (-> Binary (Try Text))
(`` (for {(~~ (static @.old))
- (#error.Success (java/lang/String::new value (..name ..utf-8)))
+ (#try.Success (java/lang/String::new value (..name ..utf-8)))
(~~ (static @.jvm))
- (#error.Success (java/lang/String::new value (..name ..utf-8)))
+ (#try.Success (java/lang/String::new value (..name ..utf-8)))
(~~ (static @.js))
- (#error.Success (|> (TextDecoder::new [(..name ..utf-8)])
- (TextDecoder::decode [value])))})))
+ (#try.Success (|> (TextDecoder::new [(..name ..utf-8)])
+ (TextDecoder::decode [value])))})))
(structure: #export UTF-8 (Codec Binary Text)
(def: encode ..to-utf8)