transformers-0.5.2.0: Concrete functor and monad transformers

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

Data.Functor.Reverse

Description

Making functors whose elements are notionally in the reverse order from the original functor.

Synopsis

- newtype Reverse f a = Reverse {
  - getReverse :: f a
  }

# Documentation

newtype Reverse f a Source #

The same functor, but with `Foldable` and `Traversable` instances that process the elements in the reverse order.

Constructors

Reverse |
Fields getReverse :: f a

Instances

Functor f => Functor (Reverse * f) # | Derived instance.
Methods fmap :: (a -> b) -> Reverse * f a -> Reverse * f b Source # (<$) :: a -> Reverse * f b -> Reverse * f a Source #
Applicative f => Applicative (Reverse * f) # | Derived instance.
Methods pure :: a -> Reverse * f a Source # (<*>) :: Reverse * f (a -> b) -> Reverse * f a -> Reverse * f b Source # (*>) :: Reverse * f a -> Reverse * f b -> Reverse * f b Source # (<*) :: Reverse * f a -> Reverse * f b -> Reverse * f a Source #
Foldable f => Foldable (Reverse * f) # | Fold from right to left.
Methods fold :: Monoid m => Reverse * f m -> m Source # foldMap :: Monoid m => (a -> m) -> Reverse * f a -> m Source # foldr :: (a -> b -> b) -> b -> Reverse * f a -> b Source # foldr' :: (a -> b -> b) -> b -> Reverse * f a -> b Source # foldl :: (b -> a -> b) -> b -> Reverse * f a -> b Source # foldl' :: (b -> a -> b) -> b -> Reverse * f a -> b Source # foldr1 :: (a -> a -> a) -> Reverse * f a -> a Source # foldl1 :: (a -> a -> a) -> Reverse * f a -> a Source # toList :: Reverse * f a -> [a] Source # null :: Reverse * f a -> Bool Source # length :: Reverse * f a -> Int Source # elem :: Eq a => a -> Reverse * f a -> Bool Source # maximum :: Ord a => Reverse * f a -> a Source # minimum :: Ord a => Reverse * f a -> a Source # sum :: Num a => Reverse * f a -> a Source # product :: Num a => Reverse * f a -> a Source #
Traversable f => Traversable (Reverse * f) # | Traverse from right to left.
Methods traverse :: Applicative f => (a -> f b) -> Reverse * f a -> f (Reverse * f b) Source # sequenceA :: Applicative f => Reverse * f (f a) -> f (Reverse * f a) Source # mapM :: Monad m => (a -> m b) -> Reverse * f a -> m (Reverse * f b) Source # sequence :: Monad m => Reverse * f (m a) -> m (Reverse * f a) Source #
Eq1 f => Eq1 (Reverse * f) # |
Methods liftEq :: (a -> b -> Bool) -> Reverse * f a -> Reverse * f b -> Bool Source #
Ord1 f => Ord1 (Reverse * f) # |
Methods liftCompare :: (a -> b -> Ordering) -> Reverse * f a -> Reverse * f b -> Ordering Source #
Read1 f => Read1 (Reverse * f) # |
Methods liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Reverse * f a) Source # liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Reverse * f a] Source #
Show1 f => Show1 (Reverse * f) # |
Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Reverse * f a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Reverse * f a] -> ShowS Source #
Alternative f => Alternative (Reverse * f) # | Derived instance.
Methods empty :: Reverse * f a Source # (<|>) :: Reverse * f a -> Reverse * f a -> Reverse * f a Source # some :: Reverse * f a -> Reverse * f [a] Source # many :: Reverse * f a -> Reverse * f [a] Source #
(Eq1 f, Eq a) => Eq (Reverse * f a) # |
Methods (==) :: Reverse * f a -> Reverse * f a -> Bool # (/=) :: Reverse * f a -> Reverse * f a -> Bool #
(Ord1 f, Ord a) => Ord (Reverse * f a) # |
Methods compare :: Reverse * f a -> Reverse * f a -> Ordering # (<) :: Reverse * f a -> Reverse * f a -> Bool # (<=) :: Reverse * f a -> Reverse * f a -> Bool # (>) :: Reverse * f a -> Reverse * f a -> Bool # (>=) :: Reverse * f a -> Reverse * f a -> Bool # max :: Reverse * f a -> Reverse * f a -> Reverse * f a # min :: Reverse * f a -> Reverse * f a -> Reverse * f a #
(Read1 f, Read a) => Read (Reverse * f a) # |
Methods readsPrec :: Int -> ReadS (Reverse * f a) Source # readList :: ReadS [Reverse * f a] Source # readPrec :: ReadPrec (Reverse * f a) Source # readListPrec :: ReadPrec [Reverse * f a] Source #
(Show1 f, Show a) => Show (Reverse * f a) # |
Methods showsPrec :: Int -> Reverse * f a -> ShowS Source # show :: Reverse * f a -> String Source # showList :: [Reverse * f a] -> ShowS Source #