Data.Functor.Compose

base-4.9.0.0: Basic libraries

Copyright | (c) Ross Paterson 2010
License | BSD-style (see the file LICENSE)
Maintainer | libraries@haskell.org
Stability | experimental
Portability | portable
Safe Haskell | Safe
Language | Haskell2010

Data.Functor.Compose

Description

Composition of functors.

Since: 4.9.0.0

Synopsis

- newtype Compose f g a = Compose {
  - getCompose :: f (g a)
  }

# Documentation

newtype Compose f g a infixr 9 Source

Right-to-left composition of functors. The composition of applicative functors is always applicative, but the composition of monads is not always a monad.

Constructors

Compose infixr 9 |
Fields getCompose :: f (g a)

Instances

(Functor f, Functor g) => Functor (Compose (TYPE Lifted) (TYPE Lifted) f g) |
Methods fmap :: (a -> b) -> Compose (TYPE Lifted) (TYPE Lifted) f g a -> Compose (TYPE Lifted) (TYPE Lifted) f g b Source (<$) :: a -> Compose (TYPE Lifted) (TYPE Lifted) f g b -> Compose (TYPE Lifted) (TYPE Lifted) f g a Source
(Applicative f, Applicative g) => Applicative (Compose (TYPE Lifted) (TYPE Lifted) f g) |
Methods pure :: a -> Compose (TYPE Lifted) (TYPE Lifted) f g a Source (<*>) :: Compose (TYPE Lifted) (TYPE Lifted) f g (a -> b) -> Compose (TYPE Lifted) (TYPE Lifted) f g a -> Compose (TYPE Lifted) (TYPE Lifted) f g b Source (*>) :: Compose (TYPE Lifted) (TYPE Lifted) f g a -> Compose (TYPE Lifted) (TYPE Lifted) f g b -> Compose (TYPE Lifted) (TYPE Lifted) f g b Source (<*) :: Compose (TYPE Lifted) (TYPE Lifted) f g a -> Compose (TYPE Lifted) (TYPE Lifted) f g b -> Compose (TYPE Lifted) (TYPE Lifted) f g a Source
(Foldable f, Foldable g) => Foldable (Compose (TYPE Lifted) (TYPE Lifted) f g) |
Methods fold :: Monoid m => Compose (TYPE Lifted) (TYPE Lifted) f g m -> m Source foldMap :: Monoid m => (a -> m) -> Compose (TYPE Lifted) (TYPE Lifted) f g a -> m Source foldr :: (a -> b -> b) -> b -> Compose (TYPE Lifted) (TYPE Lifted) f g a -> b Source foldr' :: (a -> b -> b) -> b -> Compose (TYPE Lifted) (TYPE Lifted) f g a -> b Source foldl :: (b -> a -> b) -> b -> Compose (TYPE Lifted) (TYPE Lifted) f g a -> b Source foldl' :: (b -> a -> b) -> b -> Compose (TYPE Lifted) (TYPE Lifted) f g a -> b Source foldr1 :: (a -> a -> a) -> Compose (TYPE Lifted) (TYPE Lifted) f g a -> a Source foldl1 :: (a -> a -> a) -> Compose (TYPE Lifted) (TYPE Lifted) f g a -> a Source toList :: Compose (TYPE Lifted) (TYPE Lifted) f g a -> [a] Source null :: Compose (TYPE Lifted) (TYPE Lifted) f g a -> Bool Source length :: Compose (TYPE Lifted) (TYPE Lifted) f g a -> Int Source elem :: Eq a => a -> Compose (TYPE Lifted) (TYPE Lifted) f g a -> Bool Source maximum :: Ord a => Compose (TYPE Lifted) (TYPE Lifted) f g a -> a Source minimum :: Ord a => Compose (TYPE Lifted) (TYPE Lifted) f g a -> a Source sum :: Num a => Compose (TYPE Lifted) (TYPE Lifted) f g a -> a Source product :: Num a => Compose (TYPE Lifted) (TYPE Lifted) f g a -> a Source
(Traversable f, Traversable g) => Traversable (Compose (TYPE Lifted) (TYPE Lifted) f g) |
Methods traverse :: Applicative f => (a -> f b) -> Compose (TYPE Lifted) (TYPE Lifted) f g a -> f (Compose (TYPE Lifted) (TYPE Lifted) f g b) Source sequenceA :: Applicative f => Compose (TYPE Lifted) (TYPE Lifted) f g (f a) -> f (Compose (TYPE Lifted) (TYPE Lifted) f g a) Source mapM :: Monad m => (a -> m b) -> Compose (TYPE Lifted) (TYPE Lifted) f g a -> m (Compose (TYPE Lifted) (TYPE Lifted) f g b) Source sequence :: Monad m => Compose (TYPE Lifted) (TYPE Lifted) f g (m a) -> m (Compose (TYPE Lifted) (TYPE Lifted) f g a) Source
Functor f => Generic1 (Compose (TYPE Lifted) * f g) |
Associated Types type Rep1 (Compose (TYPE Lifted) * f g :: * -> TYPE Lifted) :: * -> * Source Methods from1 :: Compose (TYPE Lifted) * f g a -> Rep1 (Compose (TYPE Lifted) * f g) a Source to1 :: Rep1 (Compose (TYPE Lifted) * f g) a -> Compose (TYPE Lifted) * f g a Source
(Alternative f, Applicative g) => Alternative (Compose (TYPE Lifted) (TYPE Lifted) f g) |
Methods empty :: Compose (TYPE Lifted) (TYPE Lifted) f g a Source (<|>) :: Compose (TYPE Lifted) (TYPE Lifted) f g a -> Compose (TYPE Lifted) (TYPE Lifted) f g a -> Compose (TYPE Lifted) (TYPE Lifted) f g a Source some :: Compose (TYPE Lifted) (TYPE Lifted) f g a -> Compose (TYPE Lifted) (TYPE Lifted) f g [a] Source many :: Compose (TYPE Lifted) (TYPE Lifted) f g a -> Compose (TYPE Lifted) (TYPE Lifted) f g [a] Source
(Show1 f, Show1 g) => Show1 (Compose (TYPE Lifted) (TYPE Lifted) f g) |
Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Compose (TYPE Lifted) (TYPE Lifted) f g a -> ShowS Source liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Compose (TYPE Lifted) (TYPE Lifted) f g a] -> ShowS Source
(Read1 f, Read1 g) => Read1 (Compose (TYPE Lifted) (TYPE Lifted) f g) |
Methods liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Compose (TYPE Lifted) (TYPE Lifted) f g a) Source liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Compose (TYPE Lifted) (TYPE Lifted) f g a] Source
(Ord1 f, Ord1 g) => Ord1 (Compose (TYPE Lifted) (TYPE Lifted) f g) |
Methods liftCompare :: (a -> b -> Ordering) -> Compose (TYPE Lifted) (TYPE Lifted) f g a -> Compose (TYPE Lifted) (TYPE Lifted) f g b -> Ordering Source
(Eq1 f, Eq1 g) => Eq1 (Compose (TYPE Lifted) (TYPE Lifted) f g) |
Methods liftEq :: (a -> b -> Bool) -> Compose (TYPE Lifted) (TYPE Lifted) f g a -> Compose (TYPE Lifted) (TYPE Lifted) f g b -> Bool Source
(Eq1 f, Eq1 g, Eq a) => Eq (Compose (TYPE Lifted) (TYPE Lifted) f g a) |
Methods (==) :: Compose (TYPE Lifted) (TYPE Lifted) f g a -> Compose (TYPE Lifted) (TYPE Lifted) f g a -> Bool Source (/=) :: Compose (TYPE Lifted) (TYPE Lifted) f g a -> Compose (TYPE Lifted) (TYPE Lifted) f g a -> Bool Source
(Data (f (g a)), Typeable k1 a, Typeable (TYPE Lifted) k, Typeable (TYPE Lifted) k1, Typeable (k -> TYPE Lifted) f, Typeable (k1 -> k) g) => Data (Compose k k1 f g a) |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall b. b -> c b) -> Compose k k1 f g a -> c (Compose k k1 f g a) Source gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Compose k k1 f g a) Source toConstr :: Compose k k1 f g a -> Constr Source dataTypeOf :: Compose k k1 f g a -> DataType Source dataCast1 :: Typeable (TYPE Lifted -> TYPE Lifted) t => (forall d. Data d => c (t d)) -> Maybe (c (Compose k k1 f g a)) Source dataCast2 :: Typeable (TYPE Lifted -> TYPE Lifted -> TYPE Lifted) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Compose k k1 f g a)) Source gmapT :: (forall b. Data b => b -> b) -> Compose k k1 f g a -> Compose k k1 f g a Source gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Compose k k1 f g a -> r Source gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Compose k k1 f g a -> r Source gmapQ :: (forall d. Data d => d -> u) -> Compose k k1 f g a -> [u] Source gmapQi :: Int -> (forall d. Data d => d -> u) -> Compose k k1 f g a -> u Source gmapM :: Monad m => (forall d. Data d => d -> m d) -> Compose k k1 f g a -> m (Compose k k1 f g a) Source gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Compose k k1 f g a -> m (Compose k k1 f g a) Source gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Compose k k1 f g a -> m (Compose k k1 f g a) Source
(Ord1 f, Ord1 g, Ord a) => Ord (Compose (TYPE Lifted) (TYPE Lifted) f g a) |
Methods compare :: Compose (TYPE Lifted) (TYPE Lifted) f g a -> Compose (TYPE Lifted) (TYPE Lifted) f g a -> Ordering Source (<) :: Compose (TYPE Lifted) (TYPE Lifted) f g a -> Compose (TYPE Lifted) (TYPE Lifted) f g a -> Bool Source (<=) :: Compose (TYPE Lifted) (TYPE Lifted) f g a -> Compose (TYPE Lifted) (TYPE Lifted) f g a -> Bool Source (>) :: Compose (TYPE Lifted) (TYPE Lifted) f g a -> Compose (TYPE Lifted) (TYPE Lifted) f g a -> Bool Source (>=) :: Compose (TYPE Lifted) (TYPE Lifted) f g a -> Compose (TYPE Lifted) (TYPE Lifted) f g a -> Bool Source max :: Compose (TYPE Lifted) (TYPE Lifted) f g a -> Compose (TYPE Lifted) (TYPE Lifted) f g a -> Compose (TYPE Lifted) (TYPE Lifted) f g a Source min :: Compose (TYPE Lifted) (TYPE Lifted) f g a -> Compose (TYPE Lifted) (TYPE Lifted) f g a -> Compose (TYPE Lifted) (TYPE Lifted) f g a Source
(Read1 f, Read1 g, Read a) => Read (Compose (TYPE Lifted) (TYPE Lifted) f g a) |
Methods readsPrec :: Int -> ReadS (Compose (TYPE Lifted) (TYPE Lifted) f g a) Source readList :: ReadS [Compose (TYPE Lifted) (TYPE Lifted) f g a] Source readPrec :: ReadPrec (Compose (TYPE Lifted) (TYPE Lifted) f g a) Source readListPrec :: ReadPrec [Compose (TYPE Lifted) (TYPE Lifted) f g a] Source
(Show1 f, Show1 g, Show a) => Show (Compose (TYPE Lifted) (TYPE Lifted) f g a) |
Methods showsPrec :: Int -> Compose (TYPE Lifted) (TYPE Lifted) f g a -> ShowS Source show :: Compose (TYPE Lifted) (TYPE Lifted) f g a -> String Source showList :: [Compose (TYPE Lifted) (TYPE Lifted) f g a] -> ShowS Source
Generic (Compose k k1 f g a) |
Associated Types type Rep (Compose k k1 f g a) :: * -> * Source Methods from :: Compose k k1 f g a -> Rep (Compose k k1 f g a) x Source to :: Rep (Compose k k1 f g a) x -> Compose k k1 f g a Source
type Rep1 (Compose k k1 f g) = D1 (MetaData "Compose" "Data.Functor.Compose" "base" True) (C1 (MetaCons "Compose" PrefixI True) (S1 (MetaSel (Just Symbol "getCompose") NoSourceUnpackedness NoSourceStrictness DecidedLazy) ((:.:) f (Rec1 g)))) |
type Rep (Compose k k1 f g a) = D1 (MetaData "Compose" "Data.Functor.Compose" "base" True) (C1 (MetaCons "Compose" PrefixI True) (S1 (MetaSel (Just Symbol "getCompose") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (f (g a))))) |