LangToGroup-0.1.0.0
Safe HaskellNone
LanguageHaskell2010

Containers.Pair

Description

Module Pair include type Pair and useful functions for work with it.

`Pair a` is just pair as `(a, a)`.

Documentation

newtype Pair a Source #

Constructors

Pair (a, a) 

Instances

Instances details
Functor Pair Source # 
Instance details

Defined in Containers.Pair

Methods

fmap :: (a -> b) -> Pair a -> Pair b #

(<$) :: a -> Pair b -> Pair a #

Applicative Pair Source # 
Instance details

Defined in Containers.Pair

Methods

pure :: a -> Pair a #

(<*>) :: Pair (a -> b) -> Pair a -> Pair b #

liftA2 :: (a -> b -> c) -> Pair a -> Pair b -> Pair c #

(*>) :: Pair a -> Pair b -> Pair b #

(<*) :: Pair a -> Pair b -> Pair a #

Foldable Pair Source # 
Instance details

Defined in Containers.Pair

Methods

fold :: Monoid m => Pair m -> m #

foldMap :: Monoid m => (a -> m) -> Pair a -> m #

foldMap' :: Monoid m => (a -> m) -> Pair a -> m #

foldr :: (a -> b -> b) -> b -> Pair a -> b #

foldr' :: (a -> b -> b) -> b -> Pair a -> b #

foldl :: (b -> a -> b) -> b -> Pair a -> b #

foldl' :: (b -> a -> b) -> b -> Pair a -> b #

foldr1 :: (a -> a -> a) -> Pair a -> a #

foldl1 :: (a -> a -> a) -> Pair a -> a #

toList :: Pair a -> [a] #

null :: Pair a -> Bool #

length :: Pair a -> Int #

elem :: Eq a => a -> Pair a -> Bool #

maximum :: Ord a => Pair a -> a #

minimum :: Ord a => Pair a -> a #

sum :: Num a => Pair a -> a #

product :: Num a => Pair a -> a #

Traversable Pair Source # 
Instance details

Defined in Containers.Pair

Methods

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

sequenceA :: Applicative f => Pair (f a) -> f (Pair a) #

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

sequence :: Monad m => Pair (m a) -> m (Pair a) #

Eq a => Eq (Pair a) Source # 
Instance details

Defined in Containers.Pair

Methods

(==) :: Pair a -> Pair a -> Bool #

(/=) :: Pair a -> Pair a -> Bool #

Ord a => Ord (Pair a) Source # 
Instance details

Defined in Containers.Pair

Methods

compare :: Pair a -> Pair a -> Ordering #

(<) :: Pair a -> Pair a -> Bool #

(<=) :: Pair a -> Pair a -> Bool #

(>) :: Pair a -> Pair a -> Bool #

(>=) :: Pair a -> Pair a -> Bool #

max :: Pair a -> Pair a -> Pair a #

min :: Pair a -> Pair a -> Pair a #

Sizable (Pair a) Source # 
Instance details

Defined in Containers

Methods

size :: Pair a -> Int Source #

Eq a => Containable (Pair a) a Source # 
Instance details

Defined in Containers

Methods

member :: a -> Pair a -> Bool Source #

notMember :: a -> Pair a -> Bool Source #

Listable (Pair a) a Source # 
Instance details

Defined in Containers

Methods

toList :: Pair a -> [a] Source #

fromList_ :: MonadFail m => [a] -> m (Pair a) Source #

Keyable (Pair a) Index Source # 
Instance details

Defined in Containers

Methods

keys :: Pair a -> [Index] Source #

keysSet :: Pair a -> Set Index Source #

Valuable (Pair a) a Source # 
Instance details

Defined in Containers

Methods

values :: Pair a -> [a] Source #

valuesSet :: Pair a -> Set a Source #

Indexable (Pair a) Index a Source # 
Instance details

Defined in Containers

Methods

(!?) :: MonadFail m => Pair a -> Index -> m a Source #

(!<>) :: Pair a -> Index -> Set a Source #

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

(.<@>) :: Getting x y (Pair a) -> Index -> Getting x y (Set a) Source #

Each (Pair a) (Pair b) a b Source # 
Instance details

Defined in Containers.Pair

Methods

each :: Traversal (Pair a) (Pair b) a b #

unPair :: Pair a -> (a, a) Source #

first :: Pair a -> a Source #

second :: Pair a -> a Source #

swap :: Pair a -> Pair a Source #

toList :: Pair a -> [a] Source #

fromList :: MonadFail m => [a] -> m (Pair a) Source #