encoding-0.10.2: A library for various character encodings

Safe Haskell | Safe-Inferred
Language | Haskell2010

Data.Encoding.Exception

Synopsis

- data EncodingException = HasNoRepresentation Char
- data DecodingException
  - = IllegalCharacter Word8
  - | UnexpectedEnd
  - | OutOfRange
  - | IllegalRepresentation [Word8]

# Documentation

data EncodingException Source #

This exception type is thrown whenever something went wrong during the encoding-process.

Constructors

HasNoRepresentation Char | Thrown if a specific character is not representable in an encoding.

#### Instances

Instances details

Exception EncodingException Source # |
Instance details Defined in Data.Encoding.Exception Methods toException :: EncodingException -> SomeException Source # fromException :: SomeException -> Maybe EncodingException Source # displayException :: EncodingException -> String Source # backtraceDesired :: EncodingException -> Bool Source #
Read EncodingException Source # |
Instance details Defined in Data.Encoding.Exception Methods readsPrec :: Int -> ReadS EncodingException Source # readList :: ReadS [EncodingException] Source # readPrec :: ReadPrec EncodingException Source # readListPrec :: ReadPrec [EncodingException] Source #
Show EncodingException Source # |
Instance details Defined in Data.Encoding.Exception Methods showsPrec :: Int -> EncodingException -> ShowS Source # show :: EncodingException -> String Source # showList :: [EncodingException] -> ShowS Source #
Eq EncodingException Source # |
Instance details Defined in Data.Encoding.Exception Methods (==) :: EncodingException -> EncodingException -> Bool Source # (/=) :: EncodingException -> EncodingException -> Bool Source #
Ord EncodingException Source # |

Instance details

Defined in Data.Encoding.Exception

Methods

compare :: EncodingException -> EncodingException -> Ordering Source #

(<) :: EncodingException -> EncodingException -> Bool Source #

(<=) :: EncodingException -> EncodingException -> Bool Source #

(>) :: EncodingException -> EncodingException -> Bool Source #

(>=) :: EncodingException -> EncodingException -> Bool Source #

max :: EncodingException -> EncodingException -> EncodingException Source #

min :: EncodingException -> EncodingException -> EncodingException Source #

Throws EncodingException PutM Source # |
Instance details Defined in Data.Encoding.ByteSink Methods throwException :: EncodingException -> PutM a Source #
Throws EncodingException PutME Source # |
Instance details Defined in Data.Encoding.ByteSink Methods throwException :: EncodingException -> PutME a Source #
Throws EncodingException StrictSink Source # |
Instance details Defined in Data.Encoding.ByteSink Methods throwException :: EncodingException -> StrictSink a Source #
Throws EncodingException StrictSinkE Source # |
Instance details Defined in Data.Encoding.ByteSink Methods throwException :: EncodingException -> StrictSinkE a Source #
Throws EncodingException StrictSinkExplicit Source # |
Instance details Defined in Data.Encoding.ByteSink Methods throwException :: EncodingException -> StrictSinkExplicit a Source #

data DecodingException Source #

This exception type is thrown whenever something went wrong during the decoding-process.

Constructors

IllegalCharacter Word8 | The sequence contained an illegal byte that couldn't be decoded.
UnexpectedEnd | more bytes were needed to allow a successfull decoding.
OutOfRange | the decoded value was out of the unicode range
IllegalRepresentation [Word8] | The character sequence encodes a character, but is illegal.

#### Instances

Instances details

Exception DecodingException Source # |
Instance details Defined in Data.Encoding.Exception Methods toException :: DecodingException -> SomeException Source # fromException :: SomeException -> Maybe DecodingException Source # displayException :: DecodingException -> String Source # backtraceDesired :: DecodingException -> Bool Source #
Read DecodingException Source # |
Instance details Defined in Data.Encoding.Exception Methods readsPrec :: Int -> ReadS DecodingException Source # readList :: ReadS [DecodingException] Source # readPrec :: ReadPrec DecodingException Source # readListPrec :: ReadPrec [DecodingException] Source #
Show DecodingException Source # |
Instance details Defined in Data.Encoding.Exception Methods showsPrec :: Int -> DecodingException -> ShowS Source # show :: DecodingException -> String Source # showList :: [DecodingException] -> ShowS Source #
Eq DecodingException Source # |
Instance details Defined in Data.Encoding.Exception Methods (==) :: DecodingException -> DecodingException -> Bool Source # (/=) :: DecodingException -> DecodingException -> Bool Source #
Ord DecodingException Source # |

Instance details

Defined in Data.Encoding.Exception

Methods

compare :: DecodingException -> DecodingException -> Ordering Source #

(<) :: DecodingException -> DecodingException -> Bool Source #

(<=) :: DecodingException -> DecodingException -> Bool Source #

(>) :: DecodingException -> DecodingException -> Bool Source #

(>=) :: DecodingException -> DecodingException -> Bool Source #

max :: DecodingException -> DecodingException -> DecodingException Source #

min :: DecodingException -> DecodingException -> DecodingException Source #

Throws DecodingException Get Source # |
Instance details Defined in Data.Encoding.ByteSource Methods throwException :: DecodingException -> Get a Source #
ByteSource (StateT ByteString (Either DecodingException)) Source # |

Instance details

Defined in Data.Encoding.ByteSource

Methods

sourceEmpty :: StateT ByteString (Either DecodingException) Bool Source #

fetchWord8 :: StateT ByteString (Either DecodingException) Word8 Source #

fetchAhead :: StateT ByteString (Either DecodingException) (Maybe a) -> StateT ByteString (Either DecodingException) (Maybe a) Source #

fetchWord16be :: StateT ByteString (Either DecodingException) Word16 Source #

fetchWord16le :: StateT ByteString (Either DecodingException) Word16 Source #

fetchWord32be :: StateT ByteString (Either DecodingException) Word32 Source #

fetchWord32le :: StateT ByteString (Either DecodingException) Word32 Source #

fetchWord64be :: StateT ByteString (Either DecodingException) Word64 Source #

fetchWord64le :: StateT ByteString (Either DecodingException) Word64 Source #

ByteSource (StateT [Char] (Either DecodingException)) Source # |

Instance details

Defined in Data.Encoding.ByteSource

Methods

sourceEmpty :: StateT [Char] (Either DecodingException) Bool Source #

fetchWord8 :: StateT [Char] (Either DecodingException) Word8 Source #

fetchAhead :: StateT [Char] (Either DecodingException) (Maybe a) -> StateT [Char] (Either DecodingException) (Maybe a) Source #

fetchWord16be :: StateT [Char] (Either DecodingException) Word16 Source #

fetchWord16le :: StateT [Char] (Either DecodingException) Word16 Source #

fetchWord32be :: StateT [Char] (Either DecodingException) Word32 Source #

fetchWord32le :: StateT [Char] (Either DecodingException) Word32 Source #

fetchWord64be :: StateT [Char] (Either DecodingException) Word64 Source #

fetchWord64le :: StateT [Char] (Either DecodingException) Word64 Source #