text-latin1-0.3: Latin-1 (including ASCII) utility functions

Safe HaskellNone

Text.Latin1

Contents

Description

Latin-1 utility functions.

Synopsis

Latin-1 checks

asciiIsLatin1 :: Ascii α -> Latin1 αSource

ASCII values are Latin-1 values.

maybeLatin1 :: Char -> Maybe Word8Source

Map a character to its Latin-1 encoding if possible, otherwise return Nothing.

latin1 :: Char -> Word8Source

Encode a Latin-1 character. No checks are performed.

Character properties

isControl :: Char -> BoolSource

Test if a character is a Latin-1 control character.

isPrintable :: Char -> BoolSource

Test if a character is a Latin-1 printable character.

isWhiteSpace :: Char -> BoolSource

Test if a character is a Latin-1 whitespace character.

isLower :: Char -> BoolSource

Test if a character is a Latin-1 lower-case letter.

isUpper :: Char -> BoolSource

Test if a character is a Latin-1 upper-case letter.

toLower :: Char -> CharSource

Map lower-case Latin-1 letters to the corresponding upper-case letters, leaving other characters as is.

toUpper :: Char -> CharSource

Map upper-case Latin-1 letters to the corresponding lower-case letters, leaving other characters as is.

isAlpha :: Char -> BoolSource

Test if a character is a Latin-1 letter.

isAlphaNum :: Char -> BoolSource

Test if a character is either a Latin-1 letter or a decimal digit.

Byte properties

isControl8 :: Word8 -> BoolSource

Test if a byte is the encoding of a Latin-1 control character.

isPrintable8 :: Word8 -> BoolSource

Test if a byte is the encoding of a Latin-1 printable character.

isWhiteSpace8 :: Word8 -> BoolSource

Test if a byte is the encoding of a Latin-1 whitespace character.

isLower8 :: Word8 -> BoolSource

Test if a byte is the encoding of a Latin-1 lower-case letter.

isUpper8 :: Word8 -> BoolSource

Test if a byte is the encoding of a Latin-1 upper-case letter.

toLower8 :: Word8 -> Word8Source

Map the encodings of lower-case Latin-1 letters to the encodings of the corresponding upper-case letters, leaving other bytes as is.

toUpper8 :: Word8 -> Word8Source

Map the encodings of upper-case Latin-1 letters to the encodings of the corresponding lower-case letters, leaving other bytes as is.

isAlpha8 :: Word8 -> BoolSource

Test if a byte is the encoding of a Latin-1 letter.

isAlphaNum8 :: Word8 -> BoolSource

Test if a byte is the encoding of either a Latin-1 letter or a decimal digit.