Data.Functor.Constant

transformers-0.5.2.0: Concrete functor and monad transformers

Copyright | (c) Ross Paterson 2010
License | BSD-style (see the file LICENSE)
Maintainer | R.Paterson@city.ac.uk
Stability | experimental
Portability | portable
Safe Haskell | Safe
Language | Haskell98

Data.Functor.Constant

Description

The constant functor.

Synopsis

- newtype Constant a b = Constant {
  - getConstant :: a
  }

# Documentation

newtype Constant a b Source #

Constant functor.

Constructors

Constant |
Fields getConstant :: a

Instances

Bifunctor (Constant *) # |
Methods bimap :: (a -> b) -> (c -> d) -> Constant * a c -> Constant * b d Source # first :: (a -> b) -> Constant * a c -> Constant * b c Source # second :: (b -> c) -> Constant * a b -> Constant * a c Source #
Eq2 (Constant *) # |
Methods liftEq2 :: (a -> b -> Bool) -> (c -> d -> Bool) -> Constant * a c -> Constant * b d -> Bool Source #
Ord2 (Constant *) # |
Methods liftCompare2 :: (a -> b -> Ordering) -> (c -> d -> Ordering) -> Constant * a c -> Constant * b d -> Ordering Source #
Read2 (Constant *) # |
Methods liftReadsPrec2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> Int -> ReadS (Constant * a b) Source # liftReadList2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> ReadS [Constant * a b] Source # liftReadPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec (Constant * a b) Source # liftReadListPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec [Constant * a b] Source #
Show2 (Constant *) # |
Methods liftShowsPrec2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> Int -> Constant * a b -> ShowS Source # liftShowList2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> [Constant * a b] -> ShowS Source #
Functor (Constant * a) # |
Methods fmap :: (a -> b) -> Constant * a a -> Constant * a b Source # (<$) :: a -> Constant * a b -> Constant * a a Source #
Monoid a => Applicative (Constant * a) # |
Methods pure :: a -> Constant * a a Source # (<*>) :: Constant * a (a -> b) -> Constant * a a -> Constant * a b Source # liftA2 :: (a -> b -> c) -> Constant * a a -> Constant * a b -> Constant * a c Source # (*>) :: Constant * a a -> Constant * a b -> Constant * a b Source # (<*) :: Constant * a a -> Constant * a b -> Constant * a a Source #
Foldable (Constant * a) # |
Methods fold :: Monoid m => Constant * a m -> m Source # foldMap :: Monoid m => (a -> m) -> Constant * a a -> m Source # foldr :: (a -> b -> b) -> b -> Constant * a a -> b Source # foldr' :: (a -> b -> b) -> b -> Constant * a a -> b Source # foldl :: (b -> a -> b) -> b -> Constant * a a -> b Source # foldl' :: (b -> a -> b) -> b -> Constant * a a -> b Source # foldr1 :: (a -> a -> a) -> Constant * a a -> a Source # foldl1 :: (a -> a -> a) -> Constant * a a -> a Source # toList :: Constant * a a -> [a] Source # null :: Constant * a a -> Bool Source # length :: Constant * a a -> Int Source # elem :: Eq a => a -> Constant * a a -> Bool Source # maximum :: Ord a => Constant * a a -> a Source # minimum :: Ord a => Constant * a a -> a Source # sum :: Num a => Constant * a a -> a Source # product :: Num a => Constant * a a -> a Source #
Traversable (Constant * a) # |
Methods traverse :: Applicative f => (a -> f b) -> Constant * a a -> f (Constant * a b) Source # sequenceA :: Applicative f => Constant * a (f a) -> f (Constant * a a) Source # mapM :: Monad m => (a -> m b) -> Constant * a a -> m (Constant * a b) Source # sequence :: Monad m => Constant * a (m a) -> m (Constant * a a) Source #
Eq a => Eq1 (Constant * a) # |
Methods liftEq :: (a -> b -> Bool) -> Constant * a a -> Constant * a b -> Bool Source #
Ord a => Ord1 (Constant * a) # |
Methods liftCompare :: (a -> b -> Ordering) -> Constant * a a -> Constant * a b -> Ordering Source #
Read a => Read1 (Constant * a) # |
Methods liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Constant * a a) Source # liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Constant * a a] Source # liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Constant * a a) Source # liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Constant * a a] Source #
Show a => Show1 (Constant * a) # |
Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Constant * a a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Constant * a a] -> ShowS Source #
Eq a => Eq (Constant k a b) # |
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) # |
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) # |
Methods readsPrec :: Int -> ReadS (Constant k a b) Source # readList :: ReadS [Constant k a b] Source # readPrec :: ReadPrec (Constant k a b) Source # readListPrec :: ReadPrec [Constant k a b] Source #
Show a => Show (Constant k a b) # |
Methods showsPrec :: Int -> Constant k a b -> ShowS Source # show :: Constant k a b -> String Source # showList :: [Constant k a b] -> ShowS Source #
Monoid a => Monoid (Constant k a b) # |
Methods mempty :: Constant k a b Source # mappend :: Constant k a b -> Constant k a b -> Constant k a b Source # mconcat :: [Constant k a b] -> Constant k a b Source #