LangToGroup-0.1.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Containers.IsoMap

Description

Module IsoMap include type IsoMap and useful functions for working with it.

IsoMap is kind of Map with isomorphism between keys and values. So, difference between keys ans values is erased, and you can use as keys any of two available sets, and other set will be used as values.

Documentation

data IsoMap a b Source #

Instances

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

Defined in Containers.IsoMap

Methods

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

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

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

Defined in Containers.IsoMap

Methods

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

show :: IsoMap a b -> String #

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

Nullable (IsoMap a b) Source # 
Instance details

Defined in Containers

Methods

nullC :: IsoMap a b -> Bool Source #

emptyC :: IsoMap a b Source #

Sizable (IsoMap a b) Source # 
Instance details

Defined in Containers

Methods

size :: IsoMap a b -> Int Source #

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

Defined in Containers

Methods

delete :: MonadFail m => b -> IsoMap a b -> m (IsoMap a b) Source #

unsafeDelete :: b -> IsoMap a b -> IsoMap a b Source #

(\>) :: b -> IsoMap a b -> IsoMap a b Source #

(<\) :: IsoMap a b -> b -> IsoMap a b Source #

(<\~) :: ASetter s t (IsoMap a b) (IsoMap a b) -> b -> s -> t Source #

(<\=) :: MonadState s m => ASetter s s (IsoMap a b) (IsoMap a b) -> b -> m () Source #

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

Defined in Containers

Methods

delete :: MonadFail m => a -> IsoMap a b -> m (IsoMap a b) Source #

unsafeDelete :: a -> IsoMap a b -> IsoMap a b Source #

(\>) :: a -> IsoMap a b -> IsoMap a b Source #

(<\) :: IsoMap a b -> a -> IsoMap a b Source #

(<\~) :: ASetter s t (IsoMap a b) (IsoMap a b) -> a -> s -> t Source #

(<\=) :: MonadState s m => ASetter s s (IsoMap a b) (IsoMap a b) -> a -> m () Source #

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

Defined in Containers

Methods

filterC :: (b -> Bool) -> IsoMap a b -> IsoMap a b Source #

(<?>) :: (b -> Bool) -> IsoMap a b -> IsoMap a b Source #

(<?>~) :: ASetter s t (IsoMap a b) (IsoMap a b) -> (b -> Bool) -> s -> t Source #

(<?>=) :: MonadState s m => ASetter s s (IsoMap a b) (IsoMap a b) -> (b -> Bool) -> m () Source #

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

Defined in Containers

Methods

filterC :: (a -> Bool) -> IsoMap a b -> IsoMap a b Source #

(<?>) :: (a -> Bool) -> IsoMap a b -> IsoMap a b Source #

(<?>~) :: ASetter s t (IsoMap a b) (IsoMap a b) -> (a -> Bool) -> s -> t Source #

(<?>=) :: MonadState s m => ASetter s s (IsoMap a b) (IsoMap a b) -> (a -> Bool) -> m () Source #

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

Defined in Containers

Methods

member :: b -> IsoMap a b -> Bool Source #

notMember :: b -> IsoMap a b -> Bool Source #

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

Defined in Containers

Methods

member :: a -> IsoMap a b -> Bool Source #

notMember :: a -> IsoMap a b -> Bool Source #

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

Defined in Containers

Methods

values :: IsoMap a b -> [b] Source #

valuesSet :: IsoMap a b -> Set b Source #

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

Defined in Containers

Methods

values :: IsoMap a b -> [a] Source #

valuesSet :: IsoMap a b -> Set a Source #

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

Defined in Containers.IsoMap

Methods

(~$) :: MonadFail m => IsoMap a b -> b -> m a Source #

(~&) :: MonadFail m => b -> IsoMap a b -> m a Source #

values :: IsoMap a b -> Set b Source #

member :: b -> IsoMap a b -> Bool Source #

filter :: (b -> Bool) -> IsoMap a b -> IsoMap a b Source #

insert :: MonadFail m => (b, a) -> IsoMap a b -> m (IsoMap a b) Source #

delete :: b -> IsoMap a b -> IsoMap a b Source #

toMap :: IsoMap a b -> Map b a Source #

fromList :: MonadFail m => [(b, a)] -> m (IsoMap a b) Source #

fromList' :: [(b, a)] -> IsoMap a b Source #

toList :: IsoMap a b -> [(b, a)] Source #

singleton :: b -> a -> IsoMap a b Source #

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

Defined in Containers.IsoMap

Methods

(~$) :: MonadFail m => IsoMap a b -> a -> m b Source #

(~&) :: MonadFail m => a -> IsoMap a b -> m b Source #

values :: IsoMap a b -> Set a Source #

member :: a -> IsoMap a b -> Bool Source #

filter :: (a -> Bool) -> IsoMap a b -> IsoMap a b Source #

insert :: MonadFail m => (a, b) -> IsoMap a b -> m (IsoMap a b) Source #

delete :: a -> IsoMap a b -> IsoMap a b Source #

toMap :: IsoMap a b -> Map a b Source #

fromList :: MonadFail m => [(a, b)] -> m (IsoMap a b) Source #

fromList' :: [(a, b)] -> IsoMap a b Source #

toList :: IsoMap a b -> [(a, b)] Source #

singleton :: a -> b -> IsoMap a b Source #

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

Defined in Containers

Methods

(!?) :: MonadFail m => IsoMap a b -> b -> m a Source #

(!<>) :: IsoMap a b -> b -> Set a Source #

(.@) :: MonadFail m => Getting x y (IsoMap a b) -> b -> Getting x y (m a) Source #

(.<@>) :: Getting x y (IsoMap a b) -> b -> Getting x y (Set a) Source #

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

Defined in Containers

Methods

(!?) :: MonadFail m => IsoMap a b -> a -> m b Source #

(!<>) :: IsoMap a b -> a -> Set b Source #

(.@) :: MonadFail m => Getting x y (IsoMap a b) -> a -> Getting x y (m b) Source #

(.<@>) :: Getting x y (IsoMap a b) -> a -> Getting x y (Set b) Source #

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

Defined in Containers

Methods

insert :: MonadFail m => (b, a) -> IsoMap a b -> m (IsoMap a b) Source #

unsafeInsert :: (b, a) -> IsoMap a b -> IsoMap a b Source #

(+>) :: (b, a) -> IsoMap a b -> IsoMap a b Source #

(<+) :: IsoMap a b -> (b, a) -> IsoMap a b Source #

(<+~) :: ASetter s t (IsoMap a b) (IsoMap a b) -> (b, a) -> s -> t Source #

(<+=) :: MonadState s m => ASetter s s (IsoMap a b) (IsoMap a b) -> (b, a) -> m () Source #

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

Defined in Containers

Methods

insert :: MonadFail m => (a, b) -> IsoMap a b -> m (IsoMap a b) Source #

unsafeInsert :: (a, b) -> IsoMap a b -> IsoMap a b Source #

(+>) :: (a, b) -> IsoMap a b -> IsoMap a b Source #

(<+) :: IsoMap a b -> (a, b) -> IsoMap a b Source #

(<+~) :: ASetter s t (IsoMap a b) (IsoMap a b) -> (a, b) -> s -> t Source #

(<+=) :: MonadState s m => ASetter s s (IsoMap a b) (IsoMap a b) -> (a, b) -> m () Source #

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

Defined in Containers

Methods

fromList :: [(a, b)] -> IsoMap a b Source #

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

Defined in Containers

Methods

toList :: IsoMap a b -> [(a, b)] Source #

fromList_ :: MonadFail m => [(a, b)] -> m (IsoMap a b) Source #

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

Defined in Containers

Methods

singleton :: (a, b) -> IsoMap a b Source #

Ord b2 => Gunctor (IsoMap a b1) (IsoMap b2 a) b1 b2 Source # 
Instance details

Defined in Containers

Methods

gmap :: (b1 -> b2) -> IsoMap a b1 -> IsoMap b2 a Source #

(<@>) :: (b1 -> b2) -> IsoMap a b1 -> IsoMap b2 a Source #

Ord a2 => Gunctor (IsoMap a1 b) (IsoMap b a2) a1 a2 Source # 
Instance details

Defined in Containers

Methods

gmap :: (a1 -> a2) -> IsoMap a1 b -> IsoMap b a2 Source #

(<@>) :: (a1 -> a2) -> IsoMap a1 b -> IsoMap b a2 Source #

Ord b2 => Gunctor (IsoMap a b1) (IsoMap a b2) b1 b2 Source # 
Instance details

Defined in Containers

Methods

gmap :: (b1 -> b2) -> IsoMap a b1 -> IsoMap a b2 Source #

(<@>) :: (b1 -> b2) -> IsoMap a b1 -> IsoMap a b2 Source #

Ord a2 => Gunctor (IsoMap a1 b) (IsoMap a2 b) a1 a2 Source # 
Instance details

Defined in Containers

Methods

gmap :: (a1 -> a2) -> IsoMap a1 b -> IsoMap a2 b Source #

(<@>) :: (a1 -> a2) -> IsoMap a1 b -> IsoMap a2 b Source #

size :: IsoMap a b -> Int Source #

mapFst :: Ord b => (a -> b) -> IsoMap a c -> IsoMap b c Source #

mapSnd :: Ord b => (a -> b) -> IsoMap c a -> IsoMap c b Source #

mapFstRev :: Ord b => (a -> b) -> IsoMap a c -> IsoMap c b Source #

mapSndRev :: Ord b => (a -> b) -> IsoMap c a -> IsoMap b c Source #