From f4cdf79bd4a75e9eafe68b9a908f4cc68682b7ef Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 5 Apr 2022 21:39:55 +0200 Subject: boom --- src/Data/Text/Encoding/Extra.hs | 11 +++++++++++ src/Data/Text/Extra.hs | 8 ++++++++ 2 files changed, 19 insertions(+) create mode 100644 src/Data/Text/Encoding/Extra.hs create mode 100644 src/Data/Text/Extra.hs (limited to 'src/Data/Text') diff --git a/src/Data/Text/Encoding/Extra.hs b/src/Data/Text/Encoding/Extra.hs new file mode 100644 index 0000000..a8e6234 --- /dev/null +++ b/src/Data/Text/Encoding/Extra.hs @@ -0,0 +1,11 @@ +module Data.Text.Encoding.Extra where + +import Data.ByteString (ByteString) +import Data.Text (Text) +import qualified Data.Text.Encoding as Text +import qualified Data.Text.Encoding.Error as Text + + +decodeUtf8Lenient :: ByteString -> Text +decodeUtf8Lenient = + Text.decodeUtf8With Text.lenientDecode diff --git a/src/Data/Text/Extra.hs b/src/Data/Text/Extra.hs new file mode 100644 index 0000000..07dd45c --- /dev/null +++ b/src/Data/Text/Extra.hs @@ -0,0 +1,8 @@ +module Data.Text.Extra where + +import Data.Text (Text) +import qualified Data.Text as Text + + +show :: Show a => a -> Text +show = Text.pack . Prelude.show -- cgit v1.2.3