aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/data/text/encoding.lux
diff options
context:
space:
mode:
authorEduardo Julian2019-07-02 23:36:02 -0400
committerEduardo Julian2019-07-02 23:36:02 -0400
commit91c0619657bcf2ac520e7dd2912188f66bbe2157 (patch)
treef26675f263eb5f0285c1674b0777a7369248fe07 /stdlib/source/lux/data/text/encoding.lux
parent4f191540f831a7bba0e262b1a6b598f99fb9b35c (diff)
Re-name "lux/data/error" to "lux/control/try".
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)