Module

Global

This module defines types for some global Javascript functions and values.

#nan

nan :: Number

Not a number (NaN)

#isNaN

isNaN :: Number -> Boolean

Test whether a number is NaN

#infinity

infinity :: Number

Positive infinity

#isFinite

isFinite :: Number -> Boolean

Test whether a number is finite

#readInt

readInt :: Int -> String -> Number

Parse an integer from a String in the specified base

#readFloat

readFloat :: String -> Number

Parse a floating point value from a String

#toFixed

toFixed :: Int -> Number -> Maybe String

Formats Number as a String with limited number of digits after the dot. May return Nothing when specified number of digits is less than 0 or greater than 20. See ECMA-262 for more information.

#toExponential

toExponential :: Int -> Number -> Maybe String

Formats Number as String in exponential notation limiting number of digits after the decimal dot. May return Nothing when specified number of digits is less than 0 or greater than 20 depending on the implementation. See ECMA-262 for more information.

#toPrecision

toPrecision :: Int -> Number -> Maybe String

Formats Number as String in fixed-point or exponential notation rounded to specified number of significant digits. May return Nothing when precision is less than 1 or greater than 21 depending on the implementation. See ECMA-262 for more information.

#decodeURI

decodeURI :: String -> Maybe String

URI decoding. Returns Nothing when given a value with undecodeable escape sequences.

#encodeURI

encodeURI :: String -> Maybe String

URI encoding. Returns Nothing when given a value with unencodeable characters.

#decodeURIComponent

decodeURIComponent :: String -> Maybe String

URI component decoding. Returns Nothing when given a value with undecodeable escape sequences.

#encodeURIComponent

encodeURIComponent :: String -> Maybe String

URI component encoding. Returns Nothing when given a value with unencodeable characters.

Modules