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

Safe HaskellSafe
LanguageHaskell98

Text.Latin1

Contents

Description

Latin-1 utility functions.

Synopsis

Latin-1 checks

data IsLatin1 Source #

Constructors

IsLatin1 

Instances

Property IsLatin1 Char Source # 

Methods

holds :: IsLatin1 -> Char -> Bool #

Property IsLatin1 Text Source # 

Methods

holds :: IsLatin1 -> Text -> Bool #

Property IsLatin1 Text Source # 

Methods

holds :: IsLatin1 -> Text -> Bool #

Property IsLatin1 α => Property IsLatin1 [α] Source # 

Methods

holds :: IsLatin1 -> [α] -> Bool #

Eq α => Eq (Latin1 α) Source # 

Methods

(==) :: Latin1 α -> Latin1 α -> Bool #

(/=) :: Latin1 α -> Latin1 α -> Bool #

Ord α => Ord (Latin1 α) Source # 

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 α) Source # 

Methods

showsPrec :: Int -> Latin1 α -> ShowS #

show :: Latin1 α -> String #

showList :: [Latin1 α] -> ShowS #

IsString α => IsString (Latin1 α) Source # 

Methods

fromString :: String -> Latin1 α #

Semigroup α => Semigroup (Latin1 α) Source # 

Methods

(<>) :: Latin1 α -> Latin1 α -> Latin1 α #

sconcat :: NonEmpty (Latin1 α) -> Latin1 α #

stimes :: Integral b => b -> Latin1 α -> Latin1 α #

Monoid α => Monoid (Latin1 α) Source # 

Methods

mempty :: Latin1 α #

mappend :: Latin1 α -> Latin1 α -> Latin1 α #

mconcat :: [Latin1 α] -> Latin1 α #

FoldCase (Latin1 Char) Source # 
FoldCase (Latin1 α) => FoldCase (Latin1 [α]) Source # 

Methods

foldCase :: Latin1 [α] -> Latin1 [α] #

foldCaseList :: [Latin1 [α]] -> [Latin1 [α]]

FoldCase (Latin1 Text) Source # 
FoldCase (Latin1 Text) Source # 
Hashable α => Hashable (Latin1 α) Source # 

Methods

hashWithSalt :: Int -> Latin1 α -> Int #

hash :: Latin1 α -> Int #

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.

latin1 :: Char -> Word8 Source #

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

Character properties

isControl :: Char -> Bool Source #

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

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.

isLower :: Char -> Bool Source #

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

isUpper :: Char -> Bool Source #

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

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.

isAlpha :: Char -> Bool Source #

Test if a character is a Latin-1 letter.

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.

isLower8 :: Word8 -> Bool Source #

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

isUpper8 :: Word8 -> Bool Source #

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

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.

isAlpha8 :: Word8 -> Bool Source #

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

isAlphaNum8 :: Word8 -> Bool Source #

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