dawg-0.8.2: Directed acyclic word graphs

Safe HaskellSafe
LanguageHaskell2010

Data.DAWG.HashMap

Description

A map from hashable keys to values.

Synopsis

Documentation

class Ord a => Hash a where Source #

Class for types which provide hash values.

Methods

hash :: a -> Int Source #

Instances
(Trans t, Ord (Node t a b)) => Hash (Node t a b) Source # 
Instance details

Defined in Data.DAWG.Node

Methods

hash :: Node t a b -> Int Source #

data HashMap a b Source #

A map from a keys to b elements where keys instantiate the Hash type class. Key/element pairs are kept in Value objects which takes care of potential hash collisions.

Constructors

HashMap 

Fields

Instances
(Eq a, Eq b) => Eq (HashMap a b) Source # 
Instance details

Defined in Data.DAWG.HashMap

Methods

(==) :: HashMap a b -> HashMap a b -> Bool #

(/=) :: HashMap a b -> HashMap a b -> Bool #

(Ord a, Ord b) => Ord (HashMap a b) Source # 
Instance details

Defined in Data.DAWG.HashMap

Methods

compare :: HashMap a b -> HashMap a b -> Ordering #

(<) :: HashMap a b -> HashMap a b -> Bool #

(<=) :: HashMap a b -> HashMap a b -> Bool #

(>) :: HashMap a b -> HashMap a b -> Bool #

(>=) :: HashMap a b -> HashMap a b -> Bool #

max :: HashMap a b -> HashMap a b -> HashMap a b #

min :: HashMap a b -> HashMap a b -> HashMap a b #

(Show a, Show b) => Show (HashMap a b) Source # 
Instance details

Defined in Data.DAWG.HashMap

Methods

showsPrec :: Int -> HashMap a b -> ShowS #

show :: HashMap a b -> String #

showList :: [HashMap a b] -> ShowS #

(Ord a, Binary a, Binary b) => Binary (HashMap a b) Source # 
Instance details

Defined in Data.DAWG.HashMap

Methods

put :: HashMap a b -> Put #

get :: Get (HashMap a b) #

putList :: [HashMap a b] -> Put #

empty :: HashMap a b Source #

Empty map.

lookup :: Hash a => a -> HashMap a b -> Maybe b Source #

Lookup element in the map.

insertUnsafe :: Hash a => a -> b -> HashMap a b -> HashMap a b Source #

Insert a new element. The function doesn't check if the element was already present in the map.

lookupUnsafe :: Hash a => a -> HashMap a b -> b Source #

Assumption: element is present in the map.

deleteUnsafe :: Hash a => a -> HashMap a b -> HashMap a b Source #

Assumption: element is present in the map.