transformers-0.5.2.0: Concrete functor and monad transformers

Copyright(c) Ross Paterson 2010
LicenseBSD-style (see the file LICENSE)
MaintainerR.Paterson@city.ac.uk
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell98

Data.Functor.Constant

Description

The constant functor.

Synopsis

Documentation

newtype Constant a b Source #

Constant functor.

Constructors

Constant 

Fields

Instances

Bifunctor (Constant *) Source # 

Methods

bimap :: (a -> b) -> (c -> d) -> Constant * a c -> Constant * b d #

first :: (a -> b) -> Constant * a c -> Constant * b c #

second :: (b -> c) -> Constant * a b -> Constant * a c #

Eq2 (Constant *) Source # 

Methods

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

Ord2 (Constant *) Source # 

Methods

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

Read2 (Constant *) Source # 

Methods

liftReadsPrec2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> Int -> ReadS (Constant * a b) #

liftReadList2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> ReadS [Constant * a b] #

liftReadPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec (Constant * a b) #

liftReadListPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec [Constant * a b] #

Show2 (Constant *) Source # 

Methods

liftShowsPrec2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> Int -> Constant * a b -> ShowS #

liftShowList2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> [Constant * a b] -> ShowS #

Functor (Constant * a) Source # 

Methods

fmap :: (a -> b) -> Constant * a a -> Constant * a b #

(<$) :: a -> Constant * a b -> Constant * a a #

Monoid a => Applicative (Constant * a) Source # 

Methods

pure :: a -> Constant * a a #

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

liftA2 :: (a -> b -> c) -> Constant * a a -> Constant * a b -> Constant * a c #

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

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

Foldable (Constant * a) Source # 

Methods

fold :: Monoid m => Constant * a m -> m #

foldMap :: Monoid m => (a -> m) -> Constant * a a -> m #

foldr :: (a -> b -> b) -> b -> Constant * a a -> b #

foldr' :: (a -> b -> b) -> b -> Constant * a a -> b #

foldl :: (b -> a -> b) -> b -> Constant * a a -> b #

foldl' :: (b -> a -> b) -> b -> Constant * a a -> b #

foldr1 :: (a -> a -> a) -> Constant * a a -> a #

foldl1 :: (a -> a -> a) -> Constant * a a -> a #

toList :: Constant * a a -> [a] #

null :: Constant * a a -> Bool #

length :: Constant * a a -> Int #

elem :: Eq a => a -> Constant * a a -> Bool #

maximum :: Ord a => Constant * a a -> a #

minimum :: Ord a => Constant * a a -> a #

sum :: Num a => Constant * a a -> a #

product :: Num a => Constant * a a -> a #

Traversable (Constant * a) Source # 

Methods

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

sequenceA :: Applicative f => Constant * a (f a) -> f (Constant * a a) #

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

sequence :: Monad m => Constant * a (m a) -> m (Constant * a a) #

Eq a => Eq1 (Constant * a) Source # 

Methods

liftEq :: (a -> b -> Bool) -> Constant * a a -> Constant * a b -> Bool #

Ord a => Ord1 (Constant * a) Source # 

Methods

liftCompare :: (a -> b -> Ordering) -> Constant * a a -> Constant * a b -> Ordering #

Read a => Read1 (Constant * a) Source # 

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Constant * a a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Constant * a a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Constant * a a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Constant * a a] #

Show a => Show1 (Constant * a) Source # 

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Constant * a a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Constant * a a] -> ShowS #

Eq a => Eq (Constant k a b) Source # 

Methods

(==) :: Constant k a b -> Constant k a b -> Bool #

(/=) :: Constant k a b -> Constant k a b -> Bool #

Ord a => Ord (Constant k a b) Source # 

Methods

compare :: Constant k a b -> Constant k a b -> Ordering #

(<) :: Constant k a b -> Constant k a b -> Bool #

(<=) :: Constant k a b -> Constant k a b -> Bool #

(>) :: Constant k a b -> Constant k a b -> Bool #

(>=) :: Constant k a b -> Constant k a b -> Bool #

max :: Constant k a b -> Constant k a b -> Constant k a b #

min :: Constant k a b -> Constant k a b -> Constant k a b #

Read a => Read (Constant k a b) Source # 
Show a => Show (Constant k a b) Source # 

Methods

showsPrec :: Int -> Constant k a b -> ShowS #

show :: Constant k a b -> String #

showList :: [Constant k a b] -> ShowS #

Monoid a => Monoid (Constant k a b) Source # 

Methods

mempty :: Constant k a b #

mappend :: Constant k a b -> Constant k a b -> Constant k a b #

mconcat :: [Constant k a b] -> Constant k a b #