Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Documentation
type Bytes = ByteString Source #
class Encode enc where Source #
Bytestring encoders for text validated for a given encoding.
class Decode enc where Source #
decode :: Bytes -> Either String (AsText enc) Source #
Decode a ByteString
to Text
with an explicit encoding.
This is intended to be used with visible type applications.
decodeText :: forall enc e. (e -> String) -> (Bytes -> Either e Text) -> Bytes -> Either String (AsText enc) Source #
wrapUnsafeDecoder :: (Bytes -> Text) -> Bytes -> Either UnicodeException Text Source #
Run an unsafe decoder safely.
Copied from Data.Text.Encoding.decodeUtf8'
, so should be bulletproof?