Safe Haskell | Safe |
---|---|
Language | Haskell98 |
Latin-1 utility functions.
- data IsLatin1 = IsLatin1
- isLatin1 :: Property IsLatin1 v => v -> Bool
- type Latin1 α = Checked IsLatin1 α
- asciiIsLatin1 :: Ascii α -> Latin1 α
- maybeLatin1 :: Char -> Maybe Word8
- latin1 :: Char -> Word8
- isControl :: Char -> Bool
- isPrintable :: Char -> Bool
- isWhiteSpace :: Char -> Bool
- isLower :: Char -> Bool
- isUpper :: Char -> Bool
- toLower :: Char -> Char
- toUpper :: Char -> Char
- isAlpha :: Char -> Bool
- isAlphaNum :: Char -> Bool
- isControl8 :: Word8 -> Bool
- isPrintable8 :: Word8 -> Bool
- isWhiteSpace8 :: Word8 -> Bool
- isLower8 :: Word8 -> Bool
- isUpper8 :: Word8 -> Bool
- toLower8 :: Word8 -> Word8
- toUpper8 :: Word8 -> Word8
- isAlpha8 :: Word8 -> Bool
- isAlphaNum8 :: Word8 -> Bool
Latin-1 checks
Property IsLatin1 Char Source # | |
Property IsLatin1 Text Source # | |
Property IsLatin1 Text Source # | |
Property IsLatin1 α => Property IsLatin1 [α] Source # | |
Eq α => Eq (Latin1 α) Source # | |
Ord α => Ord (Latin1 α) Source # | |
Show α => Show (Latin1 α) Source # | |
IsString α => IsString (Latin1 α) Source # | |
Semigroup α => Semigroup (Latin1 α) Source # | |
Monoid α => Monoid (Latin1 α) Source # | |
FoldCase (Latin1 Char) Source # | |
FoldCase (Latin1 α) => FoldCase (Latin1 [α]) Source # | |
FoldCase (Latin1 Text) Source # | |
FoldCase (Latin1 Text) Source # | |
Hashable α => Hashable (Latin1 α) Source # | |
asciiIsLatin1 :: Ascii α -> Latin1 α Source #
ASCII values are Latin-1 values.
maybeLatin1 :: Char -> Maybe Word8 Source #
Map a character to its Latin-1 encoding if possible, otherwise
return Nothing
.
Character properties
isPrintable :: Char -> Bool Source #
Test if a character is a Latin-1 printable character.
isWhiteSpace :: Char -> Bool Source #
Test if a character is a Latin-1 whitespace character.
toLower :: Char -> Char Source #
Map lower-case Latin-1 letters to the corresponding upper-case letters, leaving other characters as is.
toUpper :: Char -> Char Source #
Map upper-case Latin-1 letters to the corresponding lower-case letters, leaving other characters as is.
isAlphaNum :: Char -> Bool Source #
Test if a character is either a Latin-1 letter or a decimal digit.
Byte properties
isControl8 :: Word8 -> Bool Source #
Test if a byte is the encoding of a Latin-1 control character.
isPrintable8 :: Word8 -> Bool Source #
Test if a byte is the encoding of a Latin-1 printable character.
isWhiteSpace8 :: Word8 -> Bool Source #
Test if a byte is the encoding of a Latin-1 whitespace character.
toLower8 :: Word8 -> Word8 Source #
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 -> Word8 Source #
Map the encodings of upper-case Latin-1 letters to the encodings of the corresponding lower-case letters, leaving other bytes as is.
isAlphaNum8 :: Word8 -> Bool Source #
Test if a byte is the encoding of either a Latin-1 letter or a decimal digit.