Module

Perspectives.GlobalUnsafeStrMap

A totally unsafe StrMap, tracked by an effect.

#GLStrMap

data GLStrMap :: Type -> Type

A reference to a mutable map

The type parameter defines the type of elements of the mutable array.

Instances

#new

new :: forall a. Unit -> GLStrMap a

Create a new, empty mutable map

#peek

peek :: forall a. GLStrMap a -> String -> (Maybe a)

Get the value for a key in a global map

#poke

poke :: forall a. GLStrMap a -> String -> a -> (GLStrMap a)

Update the value for a key in a global map

#delete

delete :: forall a. GLStrMap a -> String -> Maybe a

#clear

clear :: forall a. GLStrMap a -> (GLStrMap a)

Remove all keys and values.

#ensure

ensure :: forall a. GLStrMap a -> String -> a -> a

Look up a key. Returns the value found or the default value and then puts the default under that key in the map.

#modify

modify :: forall a. GLStrMap a -> String -> (a -> a) -> a -> GLStrMap a

Modify the value at the key with a function.

#keys

keys :: forall a. GLStrMap a -> Array String

Modules