Text.Latin1

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

Safe Haskell | Safe
Language | Haskell98

Text.Latin1

Contents

- Latin-1 checks
- Character properties
- Byte properties

Description

Latin-1 utility functions.

Synopsis

- 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

data IsLatin1 #

Constructors

IsLatin1 |

Instances

Property IsLatin1 Char # |
Methods holds :: IsLatin1 -> Char -> Bool #
Property IsLatin1 Text # |
Methods holds :: IsLatin1 -> Text -> Bool #
Property IsLatin1 Text # |
Methods holds :: IsLatin1 -> Text -> Bool #
Property IsLatin1 α => Property IsLatin1 [α] # |
Methods holds :: IsLatin1 -> [α] -> Bool #
Eq α => Eq (Latin1 α) # |
Methods (==) :: Latin1 α -> Latin1 α -> Bool # (/=) :: Latin1 α -> Latin1 α -> Bool #
Ord α => Ord (Latin1 α) # |
Methods compare :: Latin1 α -> Latin1 α -> Ordering # (<) :: Latin1 α -> Latin1 α -> Bool # (<=) :: Latin1 α -> Latin1 α -> Bool # (>) :: Latin1 α -> Latin1 α -> Bool # (>=) :: Latin1 α -> Latin1 α -> Bool # max :: Latin1 α -> Latin1 α -> Latin1 α # min :: Latin1 α -> Latin1 α -> Latin1 α #
Show α => Show (Latin1 α) # |
Methods showsPrec :: Int -> Latin1 α -> ShowS # show :: Latin1 α -> String # showList :: [Latin1 α] -> ShowS #
IsString α => IsString (Latin1 α) # |
Methods fromString :: String -> Latin1 α #
Monoid α => Monoid (Latin1 α) # |
Methods mempty :: Latin1 α # mappend :: Latin1 α -> Latin1 α -> Latin1 α # mconcat :: [Latin1 α] -> Latin1 α #
FoldCase (Latin1 Char) # |
Methods foldCase :: Latin1 Char -> Latin1 Char # foldCaseList :: [Latin1 Char] -> [Latin1 Char]
FoldCase (Latin1 α) => FoldCase (Latin1 [α]) # |
Methods foldCase :: Latin1 [α] -> Latin1 [α] # foldCaseList :: [Latin1 [α]] -> [Latin1 [α]]
FoldCase (Latin1 Text) # |
Methods foldCase :: Latin1 Text -> Latin1 Text # foldCaseList :: [Latin1 Text] -> [Latin1 Text]
FoldCase (Latin1 Text) # |
Methods foldCase :: Latin1 Text -> Latin1 Text # foldCaseList :: [Latin1 Text] -> [Latin1 Text]
Hashable α => Hashable (Latin1 α) # |
Methods hashWithSalt :: Int -> Latin1 α -> Int # hash :: Latin1 α -> Int #

isLatin1 :: Property IsLatin1 v => v -> Bool #

type Latin1 α = Checked IsLatin1 α #

asciiIsLatin1 :: Ascii α -> Latin1 α #

ASCII values are Latin-1 values.

maybeLatin1 :: Char -> Maybe Word8 #

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

latin1 :: Char -> Word8 #

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

# Character properties

isControl :: Char -> Bool #

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

isPrintable :: Char -> Bool #

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

isWhiteSpace :: Char -> Bool #

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

isLower :: Char -> Bool #

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

isUpper :: Char -> Bool #

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

toLower :: Char -> Char #

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

toUpper :: Char -> Char #

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

isAlpha :: Char -> Bool #

Test if a character is a Latin-1 letter.

isAlphaNum :: Char -> Bool #

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

# Byte properties

isControl8 :: Word8 -> Bool #

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

isPrintable8 :: Word8 -> Bool #

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

isWhiteSpace8 :: Word8 -> Bool #

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

isLower8 :: Word8 -> Bool #

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

isUpper8 :: Word8 -> Bool #

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

toLower8 :: Word8 -> Word8 #

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 #

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 -> Bool #

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

isAlphaNum8 :: Word8 -> Bool #

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