Module

Data.Char.Utils

#fromCodePoint

fromCodePoint :: Int -> Maybe String

Return the character corresponding to the given Unicode code point and Nothing if the given number is outside the range 0 .. 0x10FFFF. This function uses String instead of Char because PureScript Chars must be UTF-16 code units and hence cannot represent all Unicode code points.

#isSurrogate

isSurrogate :: String -> Boolean

Return true if the given character (Unicode code point) is a high or low surrogate code point. This function uses String instead of Char because PureScript Chars must be UTF-16 code units and hence cannot represent all Unicode code points.

#toCodePoint

toCodePoint :: String -> Int

Return the Unicode code point of a character. This function uses String instead of Char because PureScript Chars must be UTF-16 code units and hence cannot represent all Unicode code points.

Example:

toCodePoint '∀' == 8704

#unsafeFromCodePoint

unsafeFromCodePoint :: Int -> String

Return the character corresponding to the given Unicode code point. Unsafe: Throws runtime exception if the given number is outside the range 0 .. 0x10FFFF. This function uses String instead of Char because PureScript Chars must be UTF-16 code units and hence cannot represent all Unicode code points.

Modules