HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulebyteslice-0.2.13.2Haskell2010

Data.Bytes.Text.Latin1

This module treats Bytes data as holding text encoded in ISO-8859-1. This encoding can only encode codepoints strictly below U+0100, but this allows each codepoint to be placed directly into a single byte. This range consists of Unicode Basic Latin, Latin-1 Supplement and C0+C1 Controls, which includes ASCII.

Strictly, ISO-8859-1 is not to be confused with ISO/IEC 8859-1 (which was the default encoding for webpages before HTML5). ISO/IEC 8859-1 lacks encodings for the C0 and C1 control characters.

With HTML5, the default encoding of webpages was changed to Windows-1252, which is _not_ compatible with ISO-8859-1. Windows-1252 uses the C1 Control range (U+0080 -- U+009F) mostly to encode a variety of printable characters. For this encoding, see Data.Bytes.Text.Windows1252.

  • 18 values
valuefromString :: String -> Bytes
#

Convert a String consisting of only characters representable by ISO-8859-1. These are encoded with ISO-8859-1. Any character with a codepoint above U+00FF is replaced by an unspecified byte.

valuedecodeDecWord :: Bytes -> Maybe Word
#

Decode machine-sized word from decimal representation. Returns Nothing on overflow. Allows any number of leading zeros. Trailing non-digit bytes cause Nothing to be returned.

Specialized Comparisons

15 declarations
valueequals1 :: Char -> Bytes -> Bool
#

Is the byte sequence, when interpreted as ISO-8859-1-encoded text, a singleton whose element matches the character?

valueequals2 :: Char -> Char -> Bytes -> Bool
#

Is the byte sequence, when interpreted as ISO-8859-1-encoded text, a doubleton whose elements match the characters?

valueequals3 :: Char -> Char -> Char -> Bytes -> Bool
#

Is the byte sequence, when interpreted as ISO-8859-1-encoded text, a tripleton whose elements match the characters?

valueequals4 :: Char -> Char -> Char -> Char -> Bytes -> Bool
#

Is the byte sequence, when interpreted as ISO-8859-1-encoded text, a quadrupleton whose elements match the characters?

valueequals5 :: Char -> Char -> Char -> Char -> Char -> Bytes -> Bool
#

Is the byte sequence, when interpreted as ISO-8859-1-encoded text, a quintupleton whose elements match the characters?