church-pair-0.1.0.1: Church encoded pair

CopyrightMatthew Harm Bekkema 2017
LicenseBSD3
Maintainermbekkema97@gmail.com
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell98

Data.Church.Pair

Description

The church encoded pair type and associated operations.

Synopsis

Documentation

newtype Pair a b Source #

The church encoded pair

Constructors

Pair (forall r. (a -> b -> r) -> r) 

Instances

Eq2 Pair Source # 

Methods

liftEq2 :: (a -> b -> Bool) -> (c -> d -> Bool) -> Pair a c -> Pair b d -> Bool #

Ord2 Pair Source # 

Methods

liftCompare2 :: (a -> b -> Ordering) -> (c -> d -> Ordering) -> Pair a c -> Pair b d -> Ordering #

Bifunctor Pair Source # 

Methods

bimap :: (a -> b) -> (c -> d) -> Pair a c -> Pair b d #

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

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

Monoid a => Monad (Pair a) Source # 

Methods

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

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

return :: a -> Pair a a #

fail :: String -> Pair a a #

Functor (Pair a) Source # 

Methods

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

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

Monoid a => Applicative (Pair a) Source # 

Methods

pure :: a -> Pair a a #

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

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

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

Foldable (Pair a) Source # 

Methods

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

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

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

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

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

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

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

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

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

null :: Pair a a -> Bool #

length :: Pair a a -> Int #

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

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

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

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

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

Traversable (Pair a) Source # 

Methods

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

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

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

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

Eq a => Eq1 (Pair a) Source # 

Methods

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

Ord a => Ord1 (Pair a) Source # 

Methods

liftCompare :: (a -> b -> Ordering) -> Pair a a -> Pair a b -> Ordering #

(Eq a, Eq b) => Eq (Pair a b) Source # 

Methods

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

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

(Ord a, Ord b) => Ord (Pair a b) Source # 

Methods

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

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

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

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

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

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

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

(Semigroup a, Semigroup b) => Semigroup (Pair a b) Source # 

Methods

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

sconcat :: NonEmpty (Pair a b) -> Pair a b #

stimes :: Integral b => b -> Pair a b -> Pair a b #

(Monoid a, Monoid b) => Monoid (Pair a b) Source # 

Methods

mempty :: Pair a b #

mappend :: Pair a b -> Pair a b -> Pair a b #

mconcat :: [Pair a b] -> Pair a b #

mkPair :: a -> b -> Pair a b Source #

Construct a Pair from two values

pair :: (a -> b -> r) -> Pair a b -> r Source #

Case analysis on Pair