Module

Data.Char.Utils

Package
purescript-stringutils
Repository
menelaos/purescript-stringutils

#fromCodePoint Source

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 Source

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 Source

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 Source

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.