Data.Bytes.Text.Latin1

byteslice-0.2.14.0: Slicing managed and unmanaged memory

Safe Haskell | None
Language | Haskell2010

Data.Bytes.Text.Latin1

Contents

- Specialized Comparisons

Description

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 `Windows1252`.

Synopsis

- toString :: Bytes -> String
- fromString :: String -> Bytes
- decodeDecWord :: Bytes -> Maybe Word
- equals1 :: Char -> Bytes -> Bool
- equals2 :: Char -> Char -> Bytes -> Bool
- equals3 :: Char -> Char -> Char -> Bytes -> Bool
- equals4 :: Char -> Char -> Char -> Char -> Bytes -> Bool
- equals5 :: Char -> Char -> Char -> Char -> Char -> Bytes -> Bool
- equals6 :: Char -> Char -> Char -> Char -> Char -> Char -> Bytes -> Bool
- equals7 :: Char -> Char -> Char -> Char -> Char -> Char -> Char -> Bytes -> Bool
- equals8 :: Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Bytes -> Bool
- equals9 :: Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Bytes -> Bool
- equals10 :: Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Bytes -> Bool
- equals11 :: Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Bytes -> Bool
- equals12 :: Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Bytes -> Bool
- equals13 :: Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Bytes -> Bool
- equals14 :: Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Bytes -> Bool
- equals15 :: Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Bytes -> Bool

# Documentation

toString :: Bytes -> String #

Interpret a byte sequence as text encoded by ISO-8859-1.

fromString :: 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.

decodeDecWord :: 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

equals1 :: Char -> Bytes -> Bool #

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

equals2 :: Char -> Char -> Bytes -> Bool #

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

equals3 :: Char -> Char -> Char -> Bytes -> Bool #

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

equals4 :: 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?

equals5 :: 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?

equals6 :: Char -> Char -> Char -> Char -> Char -> Char -> Bytes -> Bool #

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

equals7 :: Char -> Char -> Char -> Char -> Char -> Char -> Char -> Bytes -> Bool #

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

equals8 :: Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Bytes -> Bool #

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

equals9 :: Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Bytes -> Bool #

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

equals10 :: Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Bytes -> Bool #

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

equals11 :: Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Bytes -> Bool #

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

equals12 :: Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Bytes -> Bool #

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

equals13 :: Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Bytes -> Bool #

equals14 :: Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Bytes -> Bool #

equals15 :: Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Bytes -> Bool #