Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
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:
ExclamationMark
QuotationMark
NumberSign
PercentSign
Ampersand
Apostrophe
LeftParenthesis
RightParenthesis
Asterisk
Comma
HyphenMinus
FullStop
Slash
Colon
Semicolon
QuestionMark
AtSign
LeftSquareBracket
Backslash
RightSquareBracket
Underscore
LeftCurlyBracket
RightCurlyBracket
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.isControl
True
>>>
eq isSpace Data.Char.isSpace
True
>>>
eq isLower Data.Char.isLower
True
>>>
eq isUpper Data.Char.isUpper
True
>>>
eq isAlpha Data.Char.isAlpha
True
>>>
eq isAlphaNum Data.Char.isAlphaNum
True
>>>
eq isPrint Data.Char.isPrint
True
>>>
eq isDigit Data.Char.isDigit
True
>>>
eq isOctDigit Data.Char.isOctDigit
True
>>>
eq isHexDigit Data.Char.isHexDigit
True
>>>
eq isLetter Data.Char.isLetter
True
>>>
eq isMark Data.Char.isMark
True
>>>
eq isNumber Data.Char.isNumber
True
>>>
eq isPunctuation Data.Char.isPunctuation
True
>>>
eq isSymbol Data.Char.isSymbol
True
>>>
eq isSeparator Data.Char.isSeparator
True