| Safe Haskell | Safe |
|---|---|
| Language | Haskell2010 |
ASCII.Predicates
Contents
Synopsis
- isControl :: Char -> Bool
- isPrint :: Char -> Bool
- isLower :: Char -> Bool
- isUpper :: Char -> Bool
- isLetter :: Char -> Bool
- isAlpha :: Char -> Bool
- isDigit :: Char -> Bool
- isOctDigit :: Char -> Bool
- isHexDigit :: Char -> Bool
- isNumber :: Char -> Bool
- isSpace :: Char -> Bool
- isAlphaNum :: Char -> Bool
- isMark :: Char -> Bool
- isPunctuation :: Char -> Bool
- isSymbol :: Char -> Bool
- isSeparator :: Char -> Bool
Group predicates
Case predicates
isLower :: Char -> Bool Source #
Returns True for lower-case letters, from SmallLetterA to SmallLetterZ.
This function is analogous to isLower in the Data.Char module.
isUpper :: Char -> Bool Source #
Returns True for upper-case letters, from CapitalLetterA to CapitalLetterZ.
This function is analogous to isUpper in the Data.Char module.
Letter predicates
Number predicates
isOctDigit :: Char -> Bool Source #
Returns True for the characters from Digit0 to Digit7.
This function is analogous to isOctDigit in the Data.Char module.
isHexDigit :: Char -> Bool Source #
Returns True for characters in any of the following ranges:
This function is analogous to isHexDigit in the Data.Char module.
isNumber :: Char -> Bool Source #
Synonym for isDigit.
In the Data.Char module, isDigit selects only the ASCII digits 0 through 9, and isNumber selects a wider set of characters because the full Unicode character set contains more numeric characters than just the ASCII digits. In this module, these two functions are redundant, but we include this synonym for compatibility with Data.Char.
Miscellaneous predicates
isAlphaNum :: Char -> Bool Source #
This function is analogous to isAlphaNum in the Data.Char module.
isPunctuation :: Char -> Bool Source #
Returns True for the following characters:
ExclamationMarkQuotationMarkNumberSignPercentSignAmpersandApostropheLeftParenthesisRightParenthesisAsteriskCommaHyphenMinusFullStopSlashColonSemicolonQuestionMarkAtSignLeftSquareBracketBackslashRightSquareBracketUnderscoreLeftCurlyBracketRightCurlyBracket
This function is analogous to isPunctuation in the Data.Char module.
isSeparator :: Char -> Bool Source #
Returns True if the character is Space.
This function is analogous to isSeparator in the Data.Char module.
Notes
This module defines drop-in replacements for closely related definitions of the same name in the Data.Char module.
>>>import qualified Data.Char>>>import qualified Data.List>>>convert = Data.Char.chr . ASCII.Char.toInt>>>eq f g = Data.List.all (\x -> f x == g (convert x)) ASCII.Char.allCharacters
>>>eq isControl Data.Char.isControlTrue
>>>eq isSpace Data.Char.isSpaceTrue
>>>eq isLower Data.Char.isLowerTrue
>>>eq isUpper Data.Char.isUpperTrue
>>>eq isAlpha Data.Char.isAlphaTrue
>>>eq isAlphaNum Data.Char.isAlphaNumTrue
>>>eq isPrint Data.Char.isPrintTrue
>>>eq isDigit Data.Char.isDigitTrue
>>>eq isOctDigit Data.Char.isOctDigitTrue
>>>eq isHexDigit Data.Char.isHexDigitTrue
>>>eq isLetter Data.Char.isLetterTrue
>>>eq isMark Data.Char.isMarkTrue
>>>eq isNumber Data.Char.isNumberTrue
>>>eq isPunctuation Data.Char.isPunctuationTrue
>>>eq isSymbol Data.Char.isSymbolTrue
>>>eq isSeparator Data.Char.isSeparatorTrue