2013-03-17 05:24:18 +00:00
|
|
|
|
|
|
|
module Char where
|
|
|
|
|
2013-07-29 21:23:04 +00:00
|
|
|
import Native.Char
|
2013-03-17 05:24:18 +00:00
|
|
|
|
2013-05-17 10:49:31 +00:00
|
|
|
-- True for upper case letters.
|
2013-03-17 05:24:18 +00:00
|
|
|
isUpper : Char -> Bool
|
2013-07-29 21:23:04 +00:00
|
|
|
isUpper = Native.Char.isUpper
|
2013-03-17 05:24:18 +00:00
|
|
|
|
2013-05-17 10:49:31 +00:00
|
|
|
-- True for lower case letters.
|
2013-03-17 05:24:18 +00:00
|
|
|
isLower : Char -> Bool
|
2013-07-29 21:23:04 +00:00
|
|
|
isLower = Native.Char.isLower
|
2013-03-17 05:24:18 +00:00
|
|
|
|
2013-05-17 10:49:31 +00:00
|
|
|
-- True for ASCII digits (`0..9`).
|
2013-03-17 05:24:18 +00:00
|
|
|
isDigit : Char -> Bool
|
2013-07-29 21:23:04 +00:00
|
|
|
isDigit = Native.Char.isDigit
|
2013-03-17 05:24:18 +00:00
|
|
|
|
2013-05-17 10:49:31 +00:00
|
|
|
-- True for ASCII octal digits (`0..7`).
|
2013-03-17 05:24:18 +00:00
|
|
|
isOctDigit : Char -> Bool
|
2013-07-29 21:23:04 +00:00
|
|
|
isOctDigit = Native.Char.isOctDigit
|
2013-03-17 05:24:18 +00:00
|
|
|
|
2013-05-17 10:49:31 +00:00
|
|
|
-- True for ASCII hexadecimal digits (`0..9a..fA..F`).
|
2013-03-17 05:24:18 +00:00
|
|
|
isHexDigit : Char -> Bool
|
2013-07-29 21:23:04 +00:00
|
|
|
isHexDigit = Native.Char.isHexDigit
|
2013-03-17 05:24:18 +00:00
|
|
|
|
|
|
|
-- Convert to upper case.
|
|
|
|
toUpper : Char -> Char
|
2013-07-29 21:23:04 +00:00
|
|
|
toUpper = Native.Char.toUpper
|
2013-03-17 05:24:18 +00:00
|
|
|
|
|
|
|
-- Convert to lower case.
|
|
|
|
toLower : Char -> Char
|
2013-07-29 21:23:04 +00:00
|
|
|
toLower = Native.Char.toLower
|
2013-03-17 05:24:18 +00:00
|
|
|
|
|
|
|
-- Convert to upper case, according to any locale-specific case mappings.
|
|
|
|
toLocaleUpper : Char -> Char
|
2013-07-29 21:23:04 +00:00
|
|
|
toLocaleUpper = Native.Char.toLocaleUpper
|
2013-03-17 05:24:18 +00:00
|
|
|
|
|
|
|
-- Convert to lower case, according to any locale-specific case mappings.
|
|
|
|
toLocaleLower : Char -> Char
|
2013-07-29 21:23:04 +00:00
|
|
|
toLocaleLower = Native.Char.toLocaleLower
|
2013-07-25 22:07:07 +00:00
|
|
|
|
|
|
|
type KeyCode = Int
|
2013-03-17 05:24:18 +00:00
|
|
|
|
|
|
|
-- Convert to unicode.
|
2013-07-26 17:05:10 +00:00
|
|
|
toCode : Char -> KeyCode
|
2013-07-29 21:23:04 +00:00
|
|
|
toCode = Native.Char.toCode
|
2013-03-17 05:24:18 +00:00
|
|
|
|
|
|
|
-- Convert from unicode.
|
2013-07-26 17:05:10 +00:00
|
|
|
fromCode : KeyCode -> Char
|
2013-07-29 21:23:04 +00:00
|
|
|
fromCode = Native.Char.fromCode
|