module ELynx.Tools.Text
(
tShow,
fromBs,
)
where
import qualified Data.ByteString.Lazy.Char8 as BL
import Data.Text
( Text,
pack,
)
import Data.Text.Lazy (toStrict)
import Data.Text.Lazy.Encoding (decodeUtf8)
tShow :: Show a => a -> Text
tShow :: a -> Text
tShow = String -> Text
pack (String -> Text) -> (a -> String) -> a -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> String
forall a. Show a => a -> String
show
fromBs :: BL.ByteString -> Text
fromBs :: ByteString -> Text
fromBs = Text -> Text
toStrict (Text -> Text) -> (ByteString -> Text) -> ByteString -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ByteString -> Text
decodeUtf8