-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Latin-1 (including ASCII) utility functions
--   
--   This package provides various functions over the ASCII ang Latin-1
--   portions of the <a>Char</a> and <a>Word8</a> data types.
@package text-latin1
@version 0.3


-- | ASCII utility functions.
module Text.Ascii
data IsAscii
IsAscii :: IsAscii
isAscii :: Property IsAscii v => v -> Bool
type Ascii α = Checked IsAscii α

-- | Map a character to its ASCII encoding if possible, otherwise return
--   <a>Nothing</a>.
maybeAscii :: Char -> Maybe Word8

-- | Encode an ASCII character. No checks are performed.
ascii :: Char -> Word8

-- | Test if a character is an ASCII control character.
isControl :: Char -> Bool

-- | Test if a character is an ASCII printable character.
isPrintable :: Char -> Bool

-- | Test if a character is an ASCII whitespace character.
isWhiteSpace :: Char -> Bool

-- | Test if a character is the SPACE or the TAB character.
isSpaceOrTab :: Char -> Bool

-- | Test if a character is an ASCII lower-case letter.
isLower :: Char -> Bool

-- | Test if a character is an ASCII upper-case letter.
isUpper :: Char -> Bool

-- | Map lower-case ASCII letters to the corresponding upper-case letters,
--   leaving other characters as is.
toLower :: Char -> Char

-- | Map upper-case ASCII letters to the corresponding lower-case letters,
--   leaving other characters as is.
toUpper :: Char -> Char

-- | Test if a character is an ASCII letter.
isAlpha :: Char -> Bool

-- | Test if a character is either an ASCII letter or a decimal digit.
isAlphaNum :: Char -> Bool

-- | Test if a character is a decimal digit (<i>'0' ... '9'</i>).
isDecDigit :: Char -> Bool

-- | Test if a character is a non-zero decimal digit (<i>'1' ... '9'</i>).
isNzDecDigit :: Char -> Bool

-- | Map a decimal digit to the corresponding number. Return <a>Nothing</a>
--   on other inputs.
fromDecDigit :: Num a => Char -> Maybe a

-- | Map non-zero decimal digits to the corresponding numbers. Return
--   <a>Nothing</a> on other inputs.
fromNzDecDigit :: Num a => Char -> Maybe a

-- | Map decimal digits to the corresponding numbers. No checks are
--   performed.
unsafeFromDecDigit :: Num a => Char -> a

-- | Test if a character is a binary digit (<i>'0'</i> or <i>'1'</i>).
isBinDigit :: Char -> Bool

-- | Test if a character is the non-zero binary digit (<i>'1'</i>).
isNzBinDigit :: Char -> Bool

-- | Map binary digits to the corresponding numbers. Return <a>Nothing</a>
--   on other inputs.
fromBinDigit :: Num a => Char -> Maybe a

-- | Map the digit <i>'1'</i> to the number <i>1</i>. Return <a>Nothing</a>
--   on other inputs.
fromNzBinDigit :: Num a => Char -> Maybe a

-- | Map binary digits to the corresponding numbers. No checks are
--   performed.
unsafeFromBinDigit :: Num a => Char -> a

-- | Test if a character is an octal digit (<i>'0' ... '7'</i>).
isOctDigit :: Char -> Bool

-- | Test if a character is a non-zero octal digit (<i>'1' ... '7'</i>).
isNzOctDigit :: Char -> Bool

-- | Map octal digits to the corresponding numbers. Return <a>Nothing</a>
--   on other inputs.
fromOctDigit :: Num a => Char -> Maybe a

-- | Map non-zero octal digits to the corresponding numbers. Return
--   <a>Nothing</a> on other inputs.
fromNzOctDigit :: Num a => Char -> Maybe a

-- | Map octal digits to the corresponding numbers. No checks are
--   performed.
unsafeFromOctDigit :: Num a => Char -> a

-- | Test if a character is an upper-case hexadecimal digit (<i>'0' ...
--   '9'</i> or <i><tt>A</tt> ... <tt>F</tt></i>).
isUpHexDigit :: Char -> Bool

-- | Test if a character is a non-zero upper-case hexadecimal digit (<i>'1'
--   ... '9'</i> or <i><tt>A</tt> ... <tt>F</tt></i>).
isNzUpHexDigit :: Char -> Bool

-- | Map upper-case hexadecimal digits to the corresponding numbers. Return
--   <a>Nothing</a> on other inputs.
fromUpHexDigit :: Num a => Char -> Maybe a

-- | Map non-zero upper-case hexadecimal digits to the corresponding
--   numbers. Return <a>Nothing</a> on other inputs.
fromNzUpHexDigit :: Num a => Char -> Maybe a

-- | Map upper-case hexadecimal digits to the corresponding numbers. No
--   checks are performed.
unsafeFromUpHexDigit :: Num a => Char -> a

-- | Test if a character is a lower-case hexadecimal digit (<i>'0' ...
--   '9'</i> or <i><tt>a</tt> ... <tt>f</tt></i>).
isLowHexDigit :: Char -> Bool

-- | Test if a character is a non-zero lower-case hexadecimal digit (<i>'1'
--   ... '9'</i> or <i><tt>a</tt> ... <tt>f</tt></i>).
isNzLowHexDigit :: Char -> Bool

-- | Map lower-case hexadecimal digits to the corresponding numbers. Return
--   <a>Nothing</a> on other inputs.
fromLowHexDigit :: Num a => Char -> Maybe a

-- | Map non-zero lower-case hexadecimal digits to the corresponding
--   numbers. Return <a>Nothing</a> on other inputs.
fromNzLowHexDigit :: Num a => Char -> Maybe a

-- | Map lower-case hexadecimal digits to the corresponding numbers. No
--   checks are performed.
unsafeFromLowHexDigit :: Num a => Char -> a

-- | Test if a character is a hexadecimal digit (<i>'0' ... '9'</i> or
--   <i><tt>a</tt> ... <tt>f</tt></i> or <i><tt>A</tt> ... <tt>F</tt></i>).
isHexDigit :: Char -> Bool

-- | Test if a character is a non-zero hexadecimal digit (<i>'1' ...
--   '9'</i> or <i><tt>a</tt> ... <tt>f</tt></i> or <i><tt>A</tt> ...
--   <tt>F</tt></i>).
isNzHexDigit :: Char -> Bool

-- | Map hexadecimal digits to the corresponding numbers. Return
--   <a>Nothing</a> on other inputs.
fromHexDigit :: Num a => Char -> Maybe a

-- | Map non-zero hexadecimal digits to the corresponding numbers. Return
--   <a>Nothing</a> on other inputs.
fromNzHexDigit :: Num a => Char -> Maybe a

-- | Map hexadecimal digits to the corresponding numbers. No checks are
--   performed.
unsafeFromHexDigit :: Num a => Char -> a

-- | Test if a byte is the encoding of an ASCII control character.
isControl8 :: Word8 -> Bool

-- | Test if a byte is the encoding of an ASCII printable character.
isPrintable8 :: Word8 -> Bool

-- | Test if a byte is the encoding of an ASCII whitespace character.
isWhiteSpace8 :: Word8 -> Bool

-- | Test if a byte is the encoding of the SPACE or the TAB character.
isSpaceOrTab8 :: Word8 -> Bool

-- | Test if a byte is the encoding of an ASCII lower-case letter.
isLower8 :: Word8 -> Bool

-- | Test if a byte is the encoding of an ASCII upper-case letter.
isUpper8 :: Word8 -> Bool

-- | Map the encodings of lower-case ASCII letters to the encodings of the
--   corresponding upper-case letters, leaving other bytes as is.
toLower8 :: Word8 -> Word8

-- | Map the encodings of upper-case ASCII letters to the encodings of the
--   corresponding lower-case letters, leaving other bytes as is.
toUpper8 :: Word8 -> Word8

-- | Test if a byte is the encoding of an ASCII letter.
isAlpha8 :: Word8 -> Bool

-- | Test if a byte is the encoding of either an ASCII letter or a decimal
--   digit.
isAlphaNum8 :: Word8 -> Bool

-- | Test if a byte is the encoding of a decimal digit (<i>'0' ...
--   '9'</i>).
isDecDigit8 :: Word8 -> Bool

-- | Test if a byte is the encoding of a non-zero decimal digit (<i>'1' ...
--   '9'</i>).
isNzDecDigit8 :: Word8 -> Bool

-- | Map the encoding of a decimal digit to the corresponding number.
--   Return <a>Nothing</a> on other inputs.
fromDecDigit8 :: Num a => Word8 -> Maybe a

-- | Map the encoding of a non-zero decimal digit to the corresponding
--   number. Return <a>Nothing</a> on other inputs.
fromNzDecDigit8 :: Num a => Word8 -> Maybe a

-- | Map the encoding of a decimal digit to the corresponding number. No
--   checks are performed.
unsafeFromDecDigit8 :: Num a => Word8 -> a

-- | Test if a byte is the encoding of a binary digit (<i>'0'</i> or
--   <i>'1'</i>).
isBinDigit8 :: Word8 -> Bool

-- | Test if a byte is the encoding of the non-zero binary digit
--   (<i>'1'</i>).
isNzBinDigit8 :: Word8 -> Bool

-- | Map the encoding of a binary digit to the corresponding number. Return
--   <a>Nothing</a> on other inputs.
fromBinDigit8 :: Num a => Word8 -> Maybe a

-- | Map the encoding of the digit <i>'1'</i> to the number <i>1</i>.
--   Return <a>Nothing</a> on other inputs.
fromNzBinDigit8 :: Num a => Word8 -> Maybe a

-- | Map the encoding of a binary digit to the corresponding number. No
--   checks are performed.
unsafeFromBinDigit8 :: Num a => Word8 -> a

-- | Test if a byte is the encoding of an octal digit (<i>'0' ... '7'</i>).
isOctDigit8 :: Word8 -> Bool

-- | Test if a byte is the encoding of a non-zero octal digit (<i>'1' ...
--   '7'</i>).
isNzOctDigit8 :: Word8 -> Bool

-- | Map the encoding of an octal digit to the corresponding number. Return
--   <a>Nothing</a> on other inputs.
fromOctDigit8 :: Num a => Word8 -> Maybe a

-- | Map the encoding of a non-zero octal digit to the corresponding
--   number. Return <a>Nothing</a> on other inputs.
fromNzOctDigit8 :: Num a => Word8 -> Maybe a

-- | Map the encoding of an octal digit to the corresponding number. No
--   checks are performed.
unsafeFromOctDigit8 :: Num a => Word8 -> a

-- | Test if a byte is the encoding of an upper-case hexadecimal digit
--   (<i>'0' ... '9'</i> or <i><tt>A</tt> ... <tt>F</tt></i>).
isUpHexDigit8 :: Word8 -> Bool

-- | Test if a byte is the encoding of a non-zero upper-case hexadecimal
--   digit (<i>'1' ... '9'</i> or <i><tt>A</tt> ... <tt>F</tt></i>).
isNzUpHexDigit8 :: Word8 -> Bool

-- | Map the encoding of an upper-case hexadecimal digit to the
--   corresponding number. Return <a>Nothing</a> on other inputs.
fromUpHexDigit8 :: Num a => Word8 -> Maybe a

-- | Map the encoding of a non-zero upper-case hexadecimal digit to the
--   corresponding number. Return <a>Nothing</a> on other inputs.
fromNzUpHexDigit8 :: Num a => Word8 -> Maybe a

-- | Map the encoding of an upper-case hexadecimal digit to the
--   corresponding number. No checks are performed.
unsafeFromUpHexDigit8 :: Num a => Word8 -> a

-- | Test if a byte is the encoding of a lower-case hexadecimal digit
--   (<i>'0' ... '9'</i> or <i><tt>a</tt> ... <tt>f</tt></i>).
isLowHexDigit8 :: Word8 -> Bool

-- | Test if a byte is the encoding of a non-zero lower-case hexadecimal
--   digit (<i>'1' ... '9'</i> or <i><tt>a</tt> ... <tt>f</tt></i>).
isNzLowHexDigit8 :: Word8 -> Bool

-- | Map the encoding of a lower-case hexadecimal digit to the
--   corresponding number. Return <a>Nothing</a> on other inputs.
fromLowHexDigit8 :: Num a => Word8 -> Maybe a

-- | Map the encoding of a non-zero lower-case hexadecimal digit to the
--   corresponding number. Return <a>Nothing</a> on other inputs.
fromNzLowHexDigit8 :: Num a => Word8 -> Maybe a

-- | Map the encoding of a lower-case hexadecimal digit to the
--   corresponding number. No checks are performed.
unsafeFromLowHexDigit8 :: Num a => Word8 -> a

-- | Test if a byte is the encoding of a hexadecimal digit (<i>'0' ...
--   '9'</i> or <i><tt>a</tt> ... <tt>f</tt></i> or <i><tt>A</tt> ...
--   <tt>F</tt></i>).
isHexDigit8 :: Word8 -> Bool

-- | Test if a byte is the encoding of a non-zero hexadecimal digit (<i>'1'
--   ... '9'</i> or <i><tt>a</tt> ... <tt>f</tt></i> or <i><tt>A</tt> ...
--   <tt>F</tt></i>).
isNzHexDigit8 :: Word8 -> Bool

-- | Map the encoding of a hexadecimal digit to the corresponding number.
--   Return <a>Nothing</a> on other inputs.
fromHexDigit8 :: Num a => Word8 -> Maybe a

-- | Map the encoding of a non-zero hexadecimal digit to the corresponding
--   number. Return <a>Nothing</a> on other inputs.
fromNzHexDigit8 :: Num a => Word8 -> Maybe a

-- | Map the encoding of a hexadecimal digit to the corresponding number.
--   No checks are performed.
unsafeFromHexDigit8 :: Num a => Word8 -> a
instance Data.Checked.Property Text.Ascii.IsAscii GHC.Word.Word8
instance Data.Checked.Property Text.Ascii.IsAscii Data.ByteString.Internal.ByteString
instance Data.Checked.Property Text.Ascii.IsAscii Data.ByteString.Lazy.Internal.ByteString
instance Data.Checked.Property Text.Ascii.IsAscii GHC.Types.Char
instance Data.Checked.Property Text.Ascii.IsAscii α => Data.Checked.Property Text.Ascii.IsAscii [α]
instance Data.Checked.Property Text.Ascii.IsAscii Data.Text.Internal.Text
instance Data.Checked.Property Text.Ascii.IsAscii Data.Text.Internal.Lazy.Text
instance GHC.Classes.Eq α => GHC.Classes.Eq (Text.Ascii.Ascii α)
instance GHC.Classes.Ord α => GHC.Classes.Ord (Text.Ascii.Ascii α)
instance GHC.Show.Show α => GHC.Show.Show (Text.Ascii.Ascii α)
instance GHC.Base.Monoid α => GHC.Base.Monoid (Text.Ascii.Ascii α)
instance Data.String.IsString α => Data.String.IsString (Text.Ascii.Ascii α)
instance Data.Hashable.Class.Hashable α => Data.Hashable.Class.Hashable (Text.Ascii.Ascii α)
instance Data.CaseInsensitive.Internal.FoldCase (Text.Ascii.Ascii GHC.Types.Char)
instance Data.CaseInsensitive.Internal.FoldCase (Text.Ascii.Ascii α) => Data.CaseInsensitive.Internal.FoldCase (Text.Ascii.Ascii [α])
instance Data.CaseInsensitive.Internal.FoldCase (Text.Ascii.Ascii Data.ByteString.Internal.ByteString)
instance Data.CaseInsensitive.Internal.FoldCase (Text.Ascii.Ascii Data.ByteString.Lazy.Internal.ByteString)
instance Data.CaseInsensitive.Internal.FoldCase (Text.Ascii.Ascii Data.Text.Internal.Text)
instance Data.CaseInsensitive.Internal.FoldCase (Text.Ascii.Ascii Data.Text.Internal.Lazy.Text)


-- | Latin-1 utility functions.
module Text.Latin1
data IsLatin1
IsLatin1 :: IsLatin1
isLatin1 :: Property IsLatin1 v => v -> Bool
type Latin1 α = Checked IsLatin1 α

-- | ASCII values are Latin-1 values.
asciiIsLatin1 :: Ascii α -> Latin1 α

-- | Map a character to its Latin-1 encoding if possible, otherwise return
--   <a>Nothing</a>.
maybeLatin1 :: Char -> Maybe Word8

-- | Encode a Latin-1 character. No checks are performed.
latin1 :: Char -> Word8

-- | Test if a character is a Latin-1 control character.
isControl :: Char -> Bool

-- | Test if a character is a Latin-1 printable character.
isPrintable :: Char -> Bool

-- | Test if a character is a Latin-1 whitespace character.
isWhiteSpace :: Char -> Bool

-- | Test if a character is a Latin-1 lower-case letter.
isLower :: Char -> Bool

-- | Test if a character is a Latin-1 upper-case letter.
isUpper :: Char -> Bool

-- | Map lower-case Latin-1 letters to the corresponding upper-case
--   letters, leaving other characters as is.
toLower :: Char -> Char

-- | Map upper-case Latin-1 letters to the corresponding lower-case
--   letters, leaving other characters as is.
toUpper :: Char -> Char

-- | Test if a character is a Latin-1 letter.
isAlpha :: Char -> Bool

-- | Test if a character is either a Latin-1 letter or a decimal digit.
isAlphaNum :: Char -> Bool

-- | Test if a byte is the encoding of a Latin-1 control character.
isControl8 :: Word8 -> Bool

-- | Test if a byte is the encoding of a Latin-1 printable character.
isPrintable8 :: Word8 -> Bool

-- | Test if a byte is the encoding of a Latin-1 whitespace character.
isWhiteSpace8 :: Word8 -> Bool

-- | Test if a byte is the encoding of a Latin-1 lower-case letter.
isLower8 :: Word8 -> Bool

-- | Test if a byte is the encoding of a Latin-1 upper-case letter.
isUpper8 :: Word8 -> Bool

-- | Map the encodings of lower-case Latin-1 letters to the encodings of
--   the corresponding upper-case letters, leaving other bytes as is.
toLower8 :: 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.
toUpper8 :: Word8 -> Word8

-- | Test if a byte is the encoding of a Latin-1 letter.
isAlpha8 :: Word8 -> Bool

-- | Test if a byte is the encoding of either a Latin-1 letter or a decimal
--   digit.
isAlphaNum8 :: Word8 -> Bool
instance Data.Checked.Property Text.Latin1.IsLatin1 GHC.Types.Char
instance Data.Checked.Property Text.Latin1.IsLatin1 α => Data.Checked.Property Text.Latin1.IsLatin1 [α]
instance Data.Checked.Property Text.Latin1.IsLatin1 Data.Text.Internal.Text
instance Data.Checked.Property Text.Latin1.IsLatin1 Data.Text.Internal.Lazy.Text
instance GHC.Classes.Eq α => GHC.Classes.Eq (Text.Latin1.Latin1 α)
instance GHC.Classes.Ord α => GHC.Classes.Ord (Text.Latin1.Latin1 α)
instance GHC.Show.Show α => GHC.Show.Show (Text.Latin1.Latin1 α)
instance GHC.Base.Monoid α => GHC.Base.Monoid (Text.Latin1.Latin1 α)
instance Data.String.IsString α => Data.String.IsString (Text.Latin1.Latin1 α)
instance Data.Hashable.Class.Hashable α => Data.Hashable.Class.Hashable (Text.Latin1.Latin1 α)
instance Data.CaseInsensitive.Internal.FoldCase (Text.Latin1.Latin1 GHC.Types.Char)
instance Data.CaseInsensitive.Internal.FoldCase (Text.Latin1.Latin1 α) => Data.CaseInsensitive.Internal.FoldCase (Text.Latin1.Latin1 [α])
instance Data.CaseInsensitive.Internal.FoldCase (Text.Latin1.Latin1 Data.Text.Internal.Text)
instance Data.CaseInsensitive.Internal.FoldCase (Text.Latin1.Latin1 Data.Text.Internal.Lazy.Text)
