Foreign.Object
- Package
- purescript-foreign-object
- Repository
- purescript/purescript-foreign-object
This module defines a type of native homogeneous Javascript Objects.
To maximize performance, Javascript objects are not wrapped, and some native code is used even when it's not necessary.
#Object Source
#toUnfoldable Source
toUnfoldable :: forall a f. Unfoldable f => Object a -> f (Tuple String a)
Unfolds a map into a list of key/value pairs
#toAscUnfoldable Source
toAscUnfoldable :: forall a f. Unfoldable f => Object a -> f (Tuple String a)
Unfolds a map into a list of key/value pairs which is guaranteed to be sorted by key
#fromFoldable Source
fromFoldable :: forall a f. Foldable f => f (Tuple String a) -> Object a
Create an Object a
from a foldable collection of key/value pairs
#fromFoldableWith Source
fromFoldableWith :: forall a f. Foldable f => (a -> a -> a) -> f (Tuple String a) -> Object a
Create an Object a
from a foldable collection of key/value pairs, using the
specified function to combine values for duplicate keys.
#fromHomogeneous Source
fromHomogeneous :: forall a r. Homogeneous r a => Record r -> Object a
Create an Object a
from a homogeneous record, i.e. all of the record
fields are of the same type.
#mapWithKey Source
mapWithKey :: forall b a. (String -> a -> b) -> Object a -> Object b
Apply a function of two arguments to each key/value pair, producing a new map
#filterWithKey Source
filterWithKey :: forall a. (String -> a -> Boolean) -> Object a -> Object a
Filter out those key/value pairs of a map for which a predicate fails to hold.