Agda-2.6.0.1: A dependently typed functional programming language and proof assistant

Safe Haskell | Safe
Language | Haskell2010

Agda.Utils.Char

Contents

- Unicode exploration

Synopsis

- decDigit :: Char -> Int
- hexDigit :: Char -> Int
- octDigit :: Char -> Int
- data UnicodeTest
  - = IsControl
  - | IsSpace
  - | IsLower
  - | IsUpper
  - | IsAlpha
  - | IsAlphaNum
  - | IsPrint
  - | IsDigit
  - | IsOctDigit
  - | IsHexDigit
  - | IsLetter
  - | IsMark
  - | IsNumber
  - | IsPunctuation
  - | IsSymbol
  - | IsSeparator
- unicodeTests :: [(UnicodeTest, Char -> Bool)]
- testChar :: Char -> [UnicodeTest]

# Documentation

decDigit :: Char -> Int Source #

Convert a character in `'0'..'9'` into the corresponding digit `0..9`.

hexDigit :: Char -> Int Source #

Convert a character in `'0'..'9','A'..'F','a'..'f'` into the corresponding digit `0..15`.

octDigit :: Char -> Int Source #

Convert a character in `'0'..'7'` into the corresponding digit `0..7`.

# Unicode exploration

data UnicodeTest Source #

Unicode characters are divided into letters, numbers, marks, punctuation, symbols, separators (including spaces) and others (including control characters).

These are the tests that `Char` offers:

Constructors

IsControl |
IsSpace |
IsLower |
IsUpper |
IsAlpha |
IsAlphaNum |
IsPrint |
IsDigit |
IsOctDigit |
IsHexDigit |
IsLetter |
IsMark |
IsNumber |
IsPunctuation |
IsSymbol |
IsSeparator |

Instances

Eq UnicodeTest Source # |
Instance details Defined in Agda.Utils.Char Methods (==) :: UnicodeTest -> UnicodeTest -> Bool Source # (/=) :: UnicodeTest -> UnicodeTest -> Bool Source #
Ord UnicodeTest Source # |

Instance details

Defined in Agda.Utils.Char

Methods

compare :: UnicodeTest -> UnicodeTest -> Ordering Source #

(<) :: UnicodeTest -> UnicodeTest -> Bool Source #

(<=) :: UnicodeTest -> UnicodeTest -> Bool Source #

(>) :: UnicodeTest -> UnicodeTest -> Bool Source #

(>=) :: UnicodeTest -> UnicodeTest -> Bool Source #

max :: UnicodeTest -> UnicodeTest -> UnicodeTest Source #

min :: UnicodeTest -> UnicodeTest -> UnicodeTest Source #

Show UnicodeTest Source # |
Instance details Defined in Agda.Utils.Char Methods showsPrec :: Int -> UnicodeTest -> ShowS Source # show :: UnicodeTest -> String Source # showList :: [UnicodeTest] -> ShowS Source #

unicodeTests :: [(UnicodeTest, Char -> Bool)] Source #

Test names paired with their implementation.

testChar :: Char -> [UnicodeTest] Source #

Find out which tests a character satisfies.