Module

Global

Package
purescript-globalsDEPRECATED
Repository
purescript/purescript-globals

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

#nan Source

nan :: Number

Not a number (NaN)

#isNaN Source

isNaN :: Number -> Boolean

Test whether a number is NaN

#infinity Source

infinity :: Number

Positive infinity

#isFinite Source

isFinite :: Number -> Boolean

Test whether a number is finite

#readInt Source

readInt :: Int -> String -> Number

Parse an integer from a String in the specified base

#readFloat Source

readFloat :: String -> Number

Parse a floating point value from a String

#toFixed Source

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 Source

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 Source

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 Source

decodeURI :: String -> Maybe String

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

#encodeURI Source

encodeURI :: String -> Maybe String

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

#decodeURIComponent Source

decodeURIComponent :: String -> Maybe String

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

#encodeURIComponent Source

encodeURIComponent :: String -> Maybe String

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