Char

GitHub   Edit on GitHub

Utilities for working with characters. A Grain Char represents a single Unicode scalar value.

1
import Char from "char"

Values

Char.min

1
min : Number

The minimum Unicode scalar value.

Char.max

1
max : Number

The maximum Unicode scalar value.

Char.isValid

1
isValid : Number -> Bool

Returns true if the given number is a valid Unicode scalar value.

Char.code

1
code : Char -> Number

Returns the integer value of the Unicode code point for the character.

Char.fromCode

1
fromCode : Number -> Char

Returns the Char for the given Unicode code point. Fails if the code point is invalid.

Char.succ

1
succ : Char -> Char

Returns the next valid Unicode character by scalar value. Fails if the input character is U+10FFFF.

Char.pred

1
pred : Char -> Char

Returns the previous valid Unicode character by scalar value. Fails if the input character is U+0000.

Char.toString

1
toString : Char -> String

Creates a new string containing the character.

This is a notification!