HORIZON HASKELLDocslts/ghc-10.0.x8174fa42026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8174fa4 · 2026-10-11

Moduleencoding-0.10.3Haskell2010

Data.Encoding

  • 1 type
  • 1 class
  • 15 values
  • Packageencoding-0.10.3
  • Exports17
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceBase.hs
classclass Encoding enc where
#

The base class for all encodings. At least decodeChar, encodeChar and encodeable must be implemented.

Methods

  • decodeChar :: ByteSource m => enc -> m Char

    Read a single character of a ByteSource

  • encodeChar :: ByteSink m => enc -> Char -> m ()

    Encode a single character and write it to a ByteSink

  • decode :: ByteSource m => enc -> m String

    Read characters from a ByteSource until it is empty

  • encode :: ByteSink m => enc -> String -> m ()

    Encode a String and write it to a ByteSink

  • encodeable :: enc -> Char -> Bool

    Tests whether a given character is representable in the Encoding. If this yields True, encodeChar must not fail. If it yields False, encodeChar _must_ throw an exception.

Instances56Encoding, …
datadata DynEncoding
#

Wraps all possible encoding types into one data type. Used when a function needs to return an encoding.

Instances3Eq, Show, Encoding