ZVON > References > Haskell reference
| Indexes | Syntax | Prelude | Ratio | Complex | Numeric | Ix | Array | List | Maybe | >> Char << | Monad | IO | Directory | System | Time | Locale | CPUTime | Random

Module: Char
Function: digitToInt
Type: Char -> Int
Description: intToDigit and digitToInt convert between a single digit Char and the corresponding Int. digitToInt operates fails unless its argument satisfies isHexDigit, but recognises both upper and lower-case hexadecimal digits (i.e. '0'..'9', 'a'..'f', 'A'..'F'). intToDigit fails unless its argument is in the range 0..15, and generates lower-case hexadecmial digits.
Related:

Example 1

Input: digitToInt '3'

Output: 3

Example 2

Input: digitToInt 'F'

Output: 15