Data.Functor.Constant

transformers-0.5.1.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

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