HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduletext-latin1-0.3.1Haskell98

Text.Ascii

ASCII utility functions.

  • 2 types
  • 83 values

ASCII checks

5 declarations
datadata IsAscii
#
Instances20Property, Eq, Ord, Show, IsString, Semigroup, …
valueascii :: Char -> Word8
#

Encode an ASCII character. No checks are performed.

Character properties

40 declarations
valueisLower :: Char -> Bool
#

Test if a character is an ASCII lower-case letter.

valueisUpper :: Char -> Bool
#

Test if a character is an ASCII upper-case letter.

valuetoLower :: Char -> Char
#

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

valuetoUpper :: Char -> Char
#

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

valueisAlphaNum :: Char -> Bool
#

Test if a character is either an ASCII letter or a decimal digit.

valueisUpHexDigit :: Char -> Bool
#

Test if a character is an upper-case hexadecimal digit ('0' ... '9' or A ... F).

valueisNzUpHexDigit :: Char -> Bool
#

Test if a character is a non-zero upper-case hexadecimal digit ('1' ... '9' or A ... F).

valueunsafeFromUpHexDigit :: Num a => Char -> a
#

Map upper-case hexadecimal digits to the corresponding numbers. No checks are performed.

valueisLowHexDigit :: Char -> Bool
#

Test if a character is a lower-case hexadecimal digit ('0' ... '9' or a ... f).

valueisNzLowHexDigit :: Char -> Bool
#

Test if a character is a non-zero lower-case hexadecimal digit ('1' ... '9' or a ... f).

valueisHexDigit :: Char -> Bool
#

Test if a character is a hexadecimal digit ('0' ... '9' or a ... f or A ... F).

valueisNzHexDigit :: Char -> Bool
#

Test if a character is a non-zero hexadecimal digit ('1' ... '9' or a ... f or A ... F).

Byte properties

40 declarations
valueisLower8 :: Word8 -> Bool
#

Test if a byte is the encoding of an ASCII lower-case letter.

valueisUpper8 :: Word8 -> Bool
#

Test if a byte is the encoding of an ASCII upper-case letter.

valuetoLower8 :: Word8 -> Word8
#

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

valuetoUpper8 :: Word8 -> Word8
#

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

valueisAlphaNum8 :: Word8 -> Bool
#

Test if a byte is the encoding of either an ASCII letter or a decimal digit.

valueunsafeFromDecDigit8 :: Num a => Word8 -> a
#

Map the encoding of a decimal digit to the corresponding number. No checks are performed.

valueunsafeFromBinDigit8 :: Num a => Word8 -> a
#

Map the encoding of a binary digit to the corresponding number. No checks are performed.

valueunsafeFromOctDigit8 :: Num a => Word8 -> a
#

Map the encoding of an octal digit to the corresponding number. No checks are performed.

valueisUpHexDigit8 :: Word8 -> Bool
#

Test if a byte is the encoding of an upper-case hexadecimal digit ('0' ... '9' or A ... F).

valueisNzUpHexDigit8 :: Word8 -> Bool
#

Test if a byte is the encoding of a non-zero upper-case hexadecimal digit ('1' ... '9' or A ... F).

valueunsafeFromUpHexDigit8 :: Num a => Word8 -> a
#

Map the encoding of an upper-case hexadecimal digit to the corresponding number. No checks are performed.

valueisLowHexDigit8 :: Word8 -> Bool
#

Test if a byte is the encoding of a lower-case hexadecimal digit ('0' ... '9' or a ... f).

valueisNzLowHexDigit8 :: Word8 -> Bool
#

Test if a byte is the encoding of a non-zero lower-case hexadecimal digit ('1' ... '9' or a ... f).

valueunsafeFromLowHexDigit8 :: Num a => Word8 -> a
#

Map the encoding of a lower-case hexadecimal digit to the corresponding number. No checks are performed.

valueisHexDigit8 :: Word8 -> Bool
#

Test if a byte is the encoding of a hexadecimal digit ('0' ... '9' or a ... f or A ... F).

valueisNzHexDigit8 :: Word8 -> Bool
#

Test if a byte is the encoding of a non-zero hexadecimal digit ('1' ... '9' or a ... f or A ... F).

valueunsafeFromHexDigit8 :: Num a => Word8 -> a
#

Map the encoding of a hexadecimal digit to the corresponding number. No checks are performed.