effectful-core
Safe HaskellSafe-Inferred
LanguageGHC2021

Effectful.Internal.Utils.Word64Map

Description

A minimal, strict map keyed by Word64 values (adaptation of Strict).

This module is intended for internal use only, and may change without warning in subsequent releases.

Synopsis

Documentation

data Word64Map a Source #

A map of Word64 keys to values of type a.

empty :: Word64Map a Source #

The empty map.

lookup :: Word64 -> Word64Map a -> Maybe a Source #

Look up the value at a key in the map.

insert :: Word64 -> a -> Word64Map a -> Word64Map a Source #

Insert a new key/value pair in the map. If the key is already present, the associated value is replaced with the supplied one.

The value is evaluated to WHNF when it is inserted into the map.

delete :: Word64 -> Word64Map a -> Word64Map a Source #

Delete a key and its value from the map. When the key is not a member of the map, the original map is returned.

updateLookupWithKey :: (Word64 -> a -> Maybe a) -> Word64 -> Word64Map a -> (Maybe a, Word64Map a) Source #

Look up and update the value at a key in the map. The function returns the original value, if it exists, and the updated map.

The updated value is evaluated to WHNF when it is inserted into the map.