bimaps-0.1.0.2: bijections with multiple implementations.

Safe HaskellNone
LanguageHaskell2010

Data.Bijection.HashMap

Contents

Synopsis

Documentation

data HashMap k v :: * -> * -> * #

A map from keys to values. A map cannot contain duplicate keys; each key can map to at most one value.

Instances

Functor (HashMap k) 

Methods

fmap :: (a -> b) -> HashMap k a -> HashMap k b #

(<$) :: a -> HashMap k b -> HashMap k a #

Foldable (HashMap k) 

Methods

fold :: Monoid m => HashMap k m -> m #

foldMap :: Monoid m => (a -> m) -> HashMap k a -> m #

foldr :: (a -> b -> b) -> b -> HashMap k a -> b #

foldr' :: (a -> b -> b) -> b -> HashMap k a -> b #

foldl :: (b -> a -> b) -> b -> HashMap k a -> b #

foldl' :: (b -> a -> b) -> b -> HashMap k a -> b #

foldr1 :: (a -> a -> a) -> HashMap k a -> a #

foldl1 :: (a -> a -> a) -> HashMap k a -> a #

toList :: HashMap k a -> [a] #

null :: HashMap k a -> Bool #

length :: HashMap k a -> Int #

elem :: Eq a => a -> HashMap k a -> Bool #

maximum :: Ord a => HashMap k a -> a #

minimum :: Ord a => HashMap k a -> a #

sum :: Num a => HashMap k a -> a #

product :: Num a => HashMap k a -> a #

Traversable (HashMap k) 

Methods

traverse :: Applicative f => (a -> f b) -> HashMap k a -> f (HashMap k b) #

sequenceA :: Applicative f => HashMap k (f a) -> f (HashMap k a) #

mapM :: Monad m => (a -> m b) -> HashMap k a -> m (HashMap k b) #

sequence :: Monad m => HashMap k (m a) -> m (HashMap k a) #

ToJSONKey k => ToJSON1 (HashMap k) 

Methods

liftToJSON :: (a -> Value) -> ([a] -> Value) -> HashMap k a -> Value #

liftToJSONList :: (a -> Value) -> ([a] -> Value) -> [HashMap k a] -> Value #

liftToEncoding :: (a -> Encoding) -> ([a] -> Encoding) -> HashMap k a -> Encoding #

liftToEncodingList :: (a -> Encoding) -> ([a] -> Encoding) -> [HashMap k a] -> Encoding #

(FromJSONKey k, Eq k, Hashable k) => FromJSON1 (HashMap k) 

Methods

liftParseJSON :: (Value -> Parser a) -> (Value -> Parser [a]) -> Value -> Parser (HashMap k a) #

liftParseJSONList :: (Value -> Parser a) -> (Value -> Parser [a]) -> Value -> Parser [HashMap k a] #

(Eq k, Hashable k) => IsList (HashMap k v) 

Associated Types

type Item (HashMap k v) :: * #

Methods

fromList :: [Item (HashMap k v)] -> HashMap k v #

fromListN :: Int -> [Item (HashMap k v)] -> HashMap k v #

toList :: HashMap k v -> [Item (HashMap k v)] #

(Eq k, Eq v) => Eq (HashMap k v) 

Methods

(==) :: HashMap k v -> HashMap k v -> Bool #

(/=) :: HashMap k v -> HashMap k v -> Bool #

(Data k, Data v, Eq k, Hashable k) => Data (HashMap k v) 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> HashMap k v -> c (HashMap k v) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (HashMap k v) #

toConstr :: HashMap k v -> Constr #

dataTypeOf :: HashMap k v -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (HashMap k v)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (HashMap k v)) #

gmapT :: (forall b. Data b => b -> b) -> HashMap k v -> HashMap k v #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> HashMap k v -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> HashMap k v -> r #

gmapQ :: (forall d. Data d => d -> u) -> HashMap k v -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> HashMap k v -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> HashMap k v -> m (HashMap k v) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> HashMap k v -> m (HashMap k v) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> HashMap k v -> m (HashMap k v) #

(Eq k, Hashable k, Read k, Read e) => Read (HashMap k e) 
(Show k, Show v) => Show (HashMap k v) 

Methods

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

show :: HashMap k v -> String #

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

(Eq k, Hashable k) => Semigroup (HashMap k v) 

Methods

(<>) :: HashMap k v -> HashMap k v -> HashMap k v #

sconcat :: NonEmpty (HashMap k v) -> HashMap k v #

stimes :: Integral b => b -> HashMap k v -> HashMap k v #

(Eq k, Hashable k) => Monoid (HashMap k v) 

Methods

mempty :: HashMap k v #

mappend :: HashMap k v -> HashMap k v -> HashMap k v #

mconcat :: [HashMap k v] -> HashMap k v #

(Hashable k, Hashable v) => Hashable (HashMap k v) 

Methods

hashWithSalt :: Int -> HashMap k v -> Int #

hash :: HashMap k v -> Int #

(ToJSON v, ToJSONKey k) => ToJSON (HashMap k v) 
(FromJSON v, FromJSONKey k, Eq k, Hashable k) => FromJSON (HashMap k v) 
(NFData k, NFData v) => NFData (HashMap k v) 

Methods

rnf :: HashMap k v -> () #

type Item (HashMap k v) 
type Item (HashMap k v) = (k, v)
type Dom (HashMap d c) Source # 
type Dom (HashMap d c) = d
type Cod (HashMap d c) Source # 
type Cod (HashMap d c) = c

type BimapHashMap d c = Bimap (HashMap d c) (HashMap c d) Source #

Orphan instances

(Eq d, Hashable d) => DomCod (HashMap d c) Source # 

Associated Types

type Dom (HashMap d c) :: * Source #

type Cod (HashMap d c) :: * Source #

Methods

member :: HashMap d c -> Dom (HashMap d c) -> Bool Source #

lookup :: HashMap d c -> Dom (HashMap d c) -> Maybe (Cod (HashMap d c)) Source #

deleteDC :: HashMap d c -> Dom (HashMap d c) -> Maybe (Cod (HashMap d c), HashMap d c) Source #

insertDC :: HashMap d c -> (Dom (HashMap d c), Cod (HashMap d c)) -> HashMap d c Source #

toListDC :: HashMap d c -> [(Dom (HashMap d c), Cod (HashMap d c))] Source #

nullDC :: HashMap d c -> Bool Source #

emptyDC :: HashMap d c Source #

sizeDC :: HashMap d c -> Int Source #

fromListDC :: [(Dom (HashMap d c), Cod (HashMap d c))] -> HashMap d c Source #