From 91c0619657bcf2ac520e7dd2912188f66bbe2157 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 2 Jul 2019 23:36:02 -0400 Subject: Re-name "lux/data/error" to "lux/control/try". --- stdlib/source/lux/data/text/encoding.lux | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'stdlib/source/lux/data/text/encoding.lux') 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) -- cgit v1.2.3