containers-accelerate-0.1.0.0: Hashing-based container types

Copyright[2020] Trevor L. McDonell
LicenseBSD3
MaintainerTrevor L. McDonell <trevor.mcdonell@gmail.com>
Stabilityexperimental
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Data.Array.Accelerate.Data.HashMap

Contents

Description

 
Synopsis

Documentation

data HashMap k v Source #

A map from keys to values. The map can not contain duplicate keys.

Instances
(Elt k, Elt v, Show k, Show v) => Show (HashMap k v) Source # 
Instance details

Defined in Data.Array.Accelerate.Data.HashMap

Methods

showsPrec :: Int -> HashMap k v -> ShowS #

show :: HashMap k v -> String #

showList :: [HashMap k v] -> ShowS #

Generic (HashMap k v) Source # 
Instance details

Defined in Data.Array.Accelerate.Data.HashMap

Associated Types

type Rep (HashMap k v) :: Type -> Type #

Methods

from :: HashMap k v -> Rep (HashMap k v) x #

to :: Rep (HashMap k v) x -> HashMap k v #

(Elt k, Elt v) => Arrays (HashMap k v) Source # 
Instance details

Defined in Data.Array.Accelerate.Data.HashMap

Associated Types

type ArraysR (HashMap k v) :: Type

Methods

arraysR :: ArraysR (ArraysR (HashMap k v))

toArr :: ArraysR (HashMap k v) -> HashMap k v

fromArr :: HashMap k v -> ArraysR (HashMap k v)

type Rep (HashMap k v) Source # 
Instance details

Defined in Data.Array.Accelerate.Data.HashMap

type Rep (HashMap k v)
type ArraysR (HashMap k v) Source # 
Instance details

Defined in Data.Array.Accelerate.Data.HashMap

type ArraysR (HashMap k v) = GArraysR () (Rep (HashMap k v))

class Elt a => Hashable a #

The class of types that can be converted to a hash value.

Minimal complete definition

hashWithSalt

Instances
Hashable Bool 
Instance details

Defined in Data.Array.Accelerate.Data.Hashable

Methods

hashWithSalt :: Exp Int -> Exp Bool -> Exp Int #

hash :: Exp Bool -> Exp Int #

Hashable Char 
Instance details

Defined in Data.Array.Accelerate.Data.Hashable

Methods

hashWithSalt :: Exp Int -> Exp Char -> Exp Int #

hash :: Exp Char -> Exp Int #

Hashable Double 
Instance details

Defined in Data.Array.Accelerate.Data.Hashable

Hashable Float 
Instance details

Defined in Data.Array.Accelerate.Data.Hashable

Hashable Int 
Instance details

Defined in Data.Array.Accelerate.Data.Hashable

Methods

hashWithSalt :: Exp Int -> Exp Int -> Exp Int #

hash :: Exp Int -> Exp Int #

Hashable Int8 
Instance details

Defined in Data.Array.Accelerate.Data.Hashable

Methods

hashWithSalt :: Exp Int -> Exp Int8 -> Exp Int #

hash :: Exp Int8 -> Exp Int #

Hashable Int16 
Instance details

Defined in Data.Array.Accelerate.Data.Hashable

Hashable Int32 
Instance details

Defined in Data.Array.Accelerate.Data.Hashable

Hashable Int64 
Instance details

Defined in Data.Array.Accelerate.Data.Hashable

Hashable Word 
Instance details

Defined in Data.Array.Accelerate.Data.Hashable

Methods

hashWithSalt :: Exp Int -> Exp Word -> Exp Int #

hash :: Exp Word -> Exp Int #

Hashable Word8 
Instance details

Defined in Data.Array.Accelerate.Data.Hashable

Hashable Word16 
Instance details

Defined in Data.Array.Accelerate.Data.Hashable

Hashable Word32 
Instance details

Defined in Data.Array.Accelerate.Data.Hashable

Hashable Word64 
Instance details

Defined in Data.Array.Accelerate.Data.Hashable

Hashable () 
Instance details

Defined in Data.Array.Accelerate.Data.Hashable

Methods

hashWithSalt :: Exp Int -> Exp () -> Exp Int #

hash :: Exp () -> Exp Int #

Hashable Half 
Instance details

Defined in Data.Array.Accelerate.Data.Hashable

Methods

hashWithSalt :: Exp Int -> Exp Half -> Exp Int #

hash :: Exp Half -> Exp Int #

Hashable a => Hashable (Maybe a) 
Instance details

Defined in Data.Array.Accelerate.Data.Hashable

Methods

hashWithSalt :: Exp Int -> Exp (Maybe a) -> Exp Int #

hash :: Exp (Maybe a) -> Exp Int #

Hashable a => Hashable (Ratio a) 
Instance details

Defined in Data.Array.Accelerate.Data.Hashable

Methods

hashWithSalt :: Exp Int -> Exp (Ratio a) -> Exp Int #

hash :: Exp (Ratio a) -> Exp Int #

Hashable a => Hashable (Product a) 
Instance details

Defined in Data.Array.Accelerate.Data.Hashable

Methods

hashWithSalt :: Exp Int -> Exp (Product a) -> Exp Int #

hash :: Exp (Product a) -> Exp Int #

Hashable a => Hashable (Sum a) 
Instance details

Defined in Data.Array.Accelerate.Data.Hashable

Methods

hashWithSalt :: Exp Int -> Exp (Sum a) -> Exp Int #

hash :: Exp (Sum a) -> Exp Int #

Hashable a => Hashable (Max a) 
Instance details

Defined in Data.Array.Accelerate.Data.Hashable

Methods

hashWithSalt :: Exp Int -> Exp (Max a) -> Exp Int #

hash :: Exp (Max a) -> Exp Int #

Hashable a => Hashable (Min a) 
Instance details

Defined in Data.Array.Accelerate.Data.Hashable

Methods

hashWithSalt :: Exp Int -> Exp (Min a) -> Exp Int #

hash :: Exp (Min a) -> Exp Int #

Hashable a => Hashable (Complex a) 
Instance details

Defined in Data.Array.Accelerate.Data.Hashable

Methods

hashWithSalt :: Exp Int -> Exp (Complex a) -> Exp Int #

hash :: Exp (Complex a) -> Exp Int #

(Hashable a, Hashable b) => Hashable (Either a b) 
Instance details

Defined in Data.Array.Accelerate.Data.Hashable

Methods

hashWithSalt :: Exp Int -> Exp (Either a b) -> Exp Int #

hash :: Exp (Either a b) -> Exp Int #

(Hashable x0, Hashable x1) => Hashable (x0, x1) 
Instance details

Defined in Data.Array.Accelerate.Data.Hashable

Methods

hashWithSalt :: Exp Int -> Exp (x0, x1) -> Exp Int #

hash :: Exp (x0, x1) -> Exp Int #

(Hashable x0, Hashable x1, Hashable x2) => Hashable (x0, x1, x2) 
Instance details

Defined in Data.Array.Accelerate.Data.Hashable

Methods

hashWithSalt :: Exp Int -> Exp (x0, x1, x2) -> Exp Int #

hash :: Exp (x0, x1, x2) -> Exp Int #

(Hashable x0, Hashable x1, Hashable x2, Hashable x3) => Hashable (x0, x1, x2, x3) 
Instance details

Defined in Data.Array.Accelerate.Data.Hashable

Methods

hashWithSalt :: Exp Int -> Exp (x0, x1, x2, x3) -> Exp Int #

hash :: Exp (x0, x1, x2, x3) -> Exp Int #

(Hashable x0, Hashable x1, Hashable x2, Hashable x3, Hashable x4) => Hashable (x0, x1, x2, x3, x4) 
Instance details

Defined in Data.Array.Accelerate.Data.Hashable

Methods

hashWithSalt :: Exp Int -> Exp (x0, x1, x2, x3, x4) -> Exp Int #

hash :: Exp (x0, x1, x2, x3, x4) -> Exp Int #

(Hashable x0, Hashable x1, Hashable x2, Hashable x3, Hashable x4, Hashable x5) => Hashable (x0, x1, x2, x3, x4, x5) 
Instance details

Defined in Data.Array.Accelerate.Data.Hashable

Methods

hashWithSalt :: Exp Int -> Exp (x0, x1, x2, x3, x4, x5) -> Exp Int #

hash :: Exp (x0, x1, x2, x3, x4, x5) -> Exp Int #

(Hashable x0, Hashable x1, Hashable x2, Hashable x3, Hashable x4, Hashable x5, Hashable x6) => Hashable (x0, x1, x2, x3, x4, x5, x6) 
Instance details

Defined in Data.Array.Accelerate.Data.Hashable

Methods

hashWithSalt :: Exp Int -> Exp (x0, x1, x2, x3, x4, x5, x6) -> Exp Int #

hash :: Exp (x0, x1, x2, x3, x4, x5, x6) -> Exp Int #

(Hashable x0, Hashable x1, Hashable x2, Hashable x3, Hashable x4, Hashable x5, Hashable x6, Hashable x7) => Hashable (x0, x1, x2, x3, x4, x5, x6, x7) 
Instance details

Defined in Data.Array.Accelerate.Data.Hashable

Methods

hashWithSalt :: Exp Int -> Exp (x0, x1, x2, x3, x4, x5, x6, x7) -> Exp Int #

hash :: Exp (x0, x1, x2, x3, x4, x5, x6, x7) -> Exp Int #

(Hashable x0, Hashable x1, Hashable x2, Hashable x3, Hashable x4, Hashable x5, Hashable x6, Hashable x7, Hashable x8) => Hashable (x0, x1, x2, x3, x4, x5, x6, x7, x8) 
Instance details

Defined in Data.Array.Accelerate.Data.Hashable

Methods

hashWithSalt :: Exp Int -> Exp (x0, x1, x2, x3, x4, x5, x6, x7, x8) -> Exp Int #

hash :: Exp (x0, x1, x2, x3, x4, x5, x6, x7, x8) -> Exp Int #

(Hashable x0, Hashable x1, Hashable x2, Hashable x3, Hashable x4, Hashable x5, Hashable x6, Hashable x7, Hashable x8, Hashable x9) => Hashable (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) 
Instance details

Defined in Data.Array.Accelerate.Data.Hashable

Methods

hashWithSalt :: Exp Int -> Exp (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) -> Exp Int #

hash :: Exp (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) -> Exp Int #

(Hashable x0, Hashable x1, Hashable x2, Hashable x3, Hashable x4, Hashable x5, Hashable x6, Hashable x7, Hashable x8, Hashable x9, Hashable x10) => Hashable (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) 
Instance details

Defined in Data.Array.Accelerate.Data.Hashable

Methods

hashWithSalt :: Exp Int -> Exp (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) -> Exp Int #

hash :: Exp (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) -> Exp Int #

(Hashable x0, Hashable x1, Hashable x2, Hashable x3, Hashable x4, Hashable x5, Hashable x6, Hashable x7, Hashable x8, Hashable x9, Hashable x10, Hashable x11) => Hashable (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11) 
Instance details

Defined in Data.Array.Accelerate.Data.Hashable

Methods

hashWithSalt :: Exp Int -> Exp (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11) -> Exp Int #

hash :: Exp (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11) -> Exp Int #

(Hashable x0, Hashable x1, Hashable x2, Hashable x3, Hashable x4, Hashable x5, Hashable x6, Hashable x7, Hashable x8, Hashable x9, Hashable x10, Hashable x11, Hashable x12) => Hashable (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12) 
Instance details

Defined in Data.Array.Accelerate.Data.Hashable

Methods

hashWithSalt :: Exp Int -> Exp (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12) -> Exp Int #

hash :: Exp (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12) -> Exp Int #

(Hashable x0, Hashable x1, Hashable x2, Hashable x3, Hashable x4, Hashable x5, Hashable x6, Hashable x7, Hashable x8, Hashable x9, Hashable x10, Hashable x11, Hashable x12, Hashable x13) => Hashable (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13) 
Instance details

Defined in Data.Array.Accelerate.Data.Hashable

Methods

hashWithSalt :: Exp Int -> Exp (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13) -> Exp Int #

hash :: Exp (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13) -> Exp Int #

(Hashable x0, Hashable x1, Hashable x2, Hashable x3, Hashable x4, Hashable x5, Hashable x6, Hashable x7, Hashable x8, Hashable x9, Hashable x10, Hashable x11, Hashable x12, Hashable x13, Hashable x14) => Hashable (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14) 
Instance details

Defined in Data.Array.Accelerate.Data.Hashable

Methods

hashWithSalt :: Exp Int -> Exp (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14) -> Exp Int #

hash :: Exp (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14) -> Exp Int #

(Hashable x0, Hashable x1, Hashable x2, Hashable x3, Hashable x4, Hashable x5, Hashable x6, Hashable x7, Hashable x8, Hashable x9, Hashable x10, Hashable x11, Hashable x12, Hashable x13, Hashable x14, Hashable x15) => Hashable (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15) 
Instance details

Defined in Data.Array.Accelerate.Data.Hashable

Methods

hashWithSalt :: Exp Int -> Exp (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15) -> Exp Int #

hash :: Exp (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15) -> Exp Int #

Construction

fromVector :: (Hashable k, Elt v) => Acc (Vector (k, v)) -> Acc (HashMap k v) Source #

O(n log n) Construct a map from the supplied (key,value) pairs

Basic interface

size :: (Elt k, Elt v) => Acc (HashMap k v) -> Exp Int Source #

O(1) Return the number of key-value mappings

member :: (Eq k, Hashable k, Elt v) => Exp k -> Acc (HashMap k v) -> Exp Bool Source #

O(k) Return True if the specified key is present in the map, False otherwise

lookup :: (Eq k, Hashable k, Elt v) => Exp k -> Acc (HashMap k v) -> Exp (Maybe v) Source #

O(k) Return the value to which the specified key is mapped, or Nothing if the map contains no mapping for the key.

insert :: (Eq k, Hashable k, Elt v) => Acc (Vector (k, v)) -> Acc (HashMap k v) -> Acc (HashMap k v) Source #

Insert new (key,value) pairs into the map. If the key is already present in the map, the associated value is replaced with the supplied value.

insertWith :: (Eq k, Hashable k, Elt v) => (Exp v -> Exp v -> Exp v) -> Acc (Vector (k, v)) -> Acc (HashMap k v) -> Acc (HashMap k v) Source #

Insert with a function combining the new value and old value. Each pair will be inserted into the map if the key does not already exist. If the key exists, the pair '(key, f new_value old_value)' will be inserted.

insertWithKey :: (Eq k, Hashable k, Elt v) => (Exp k -> Exp v -> Exp v -> Exp v) -> Acc (Vector (k, v)) -> Acc (HashMap k v) -> Acc (HashMap k v) Source #

O(n log n) Insert values into the map using a function to combine the new value and old value. Each pair will be inserted into the map if the key does not already exist. If the key exists, the pair '(key, f key new_value old_value)' will be inserted.

delete :: (Eq k, Hashable k, Elt v) => Acc (Vector k) -> Acc (HashMap k v) -> Acc (HashMap k v) Source #

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

adjust :: (Eq k, Hashable k, Elt v) => (Exp v -> Exp v) -> Acc (Vector k) -> Acc (HashMap k v) -> Acc (HashMap k v) Source #

Update a value at a specific key using the provided function. When the key is not a member of the map, that key is ignored.

adjustWithKey :: (Eq k, Hashable k, Elt v) => (Exp k -> Exp v -> Exp v) -> Acc (Vector k) -> Acc (HashMap k v) -> Acc (HashMap k v) Source #

Update a value at a specific key using the provided function. When the key is not a member of the map, that key is ignored.

Transformations

map :: (Elt k, Elt v1, Elt v2) => (Exp v1 -> Exp v2) -> Acc (HashMap k v1) -> Acc (HashMap k v2) Source #

O(n) Transform the map by applying a function to every value

mapWithKey :: (Elt k, Elt v1, Elt v2) => (Exp k -> Exp v1 -> Exp v2) -> Acc (HashMap k v1) -> Acc (HashMap k v2) Source #

O(n) Transform this map by applying a function to every value

Conversions

keys :: (Elt k, Elt v) => Acc (HashMap k v) -> Acc (Vector k) Source #

O(1) Return this map's keys

elems :: (Elt k, Elt v) => Acc (HashMap k v) -> Acc (Vector v) Source #

O(1) Return this map's values

assocs :: (Elt k, Elt v) => Acc (HashMap k v) -> Acc (Vector (k, v)) Source #

O(1) Return this map's (key,value) pairs