| 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.
Instances
Methods
fold :: Monoid m => Compose * * f g m -> m Source #
foldMap :: Monoid m => (a -> m) -> Compose * * f g a -> m Source #
foldr :: (a -> b -> b) -> b -> Compose * * f g a -> b Source #
foldr' :: (a -> b -> b) -> b -> Compose * * f g a -> b Source #
foldl :: (b -> a -> b) -> b -> Compose * * f g a -> b Source #
foldl' :: (b -> a -> b) -> b -> Compose * * f g a -> b Source #
foldr1 :: (a -> a -> a) -> Compose * * f g a -> a Source #
foldl1 :: (a -> a -> a) -> Compose * * f g a -> a Source #
toList :: Compose * * f g a -> [a] Source #
null :: Compose * * f g a -> Bool Source #
length :: Compose * * f g a -> Int Source #
elem :: Eq a => a -> Compose * * f g a -> Bool Source #
maximum :: Ord a => Compose * * f g a -> a Source #
minimum :: Ord a => Compose * * f g a -> a Source #
Methods
traverse :: Applicative f => (a -> f b) -> Compose * * f g a -> f (Compose * * f g b) Source #
sequenceA :: Applicative f => Compose * * f g (f a) -> f (Compose * * f g a) Source #
mapM :: Monad m => (a -> m b) -> Compose * * f g a -> m (Compose * * f g b) Source #
sequence :: Monad m => Compose * * f g (m a) -> m (Compose * * f g a) Source #
Methods
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall b. b -> c b) -> Compose k1 k f g a -> c (Compose k1 k f g a) Source #
gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Compose k1 k f g a) Source #
toConstr :: Compose k1 k f g a -> Constr Source #
dataTypeOf :: Compose k1 k f g a -> DataType Source #
dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Compose k1 k f g a)) Source #
dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Compose k1 k f g a)) Source #
gmapT :: (forall b. Data b => b -> b) -> Compose k1 k f g a -> Compose k1 k f g a Source #
gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Compose k1 k f g a -> r Source #
gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Compose k1 k f g a -> r Source #
gmapQ :: (forall d. Data d => d -> u) -> Compose k1 k f g a -> [u] Source #
gmapQi :: Int -> (forall d. Data d => d -> u) -> Compose k1 k f g a -> u Source #
gmapM :: Monad m => (forall d. Data d => d -> m d) -> Compose k1 k f g a -> m (Compose k1 k f g a) Source #
gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Compose k1 k f g a -> m (Compose k1 k f g a) Source #
gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Compose k1 k f g a -> m (Compose k1 k f g a) Source #
Methods
compare :: Compose * * f g a -> Compose * * f g a -> Ordering #
(<) :: Compose * * f g a -> Compose * * f g a -> Bool #
(<=) :: Compose * * f g a -> Compose * * f g a -> Bool #
(>) :: Compose * * f g a -> Compose * * f g a -> Bool #
(>=) :: Compose * * f g a -> Compose * * f g a -> Bool #
max :: Compose * * f g a -> Compose * * f g a -> Compose * * f g a #
min :: Compose * * f g a -> Compose * * f g a -> Compose * * f g a #