transformers-0.6.0.4: Concrete functor and monad transformers
Copyright(c) Russell O'Connor 2009
LicenseBSD-style (see the file LICENSE)
MaintainerR.Paterson@city.ac.uk
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Data.Functor.Reverse

Description

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

Synopsis

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

Instances

Instances details
Generic1 (Reverse f :: k -> Type) Source # 
Instance details

Defined in Data.Functor.Reverse

Associated Types

type Rep1 (Reverse f) :: k -> Type #

Methods

from1 :: forall (a :: k0). Reverse f a -> Rep1 (Reverse f) a #

to1 :: forall (a :: k0). Rep1 (Reverse f) a -> Reverse f a #

Monad m => Monad (Reverse m) Source #

Derived instance.

Instance details

Defined in Data.Functor.Reverse

Methods

(>>=) :: Reverse m a -> (a -> Reverse m b) -> Reverse m b #

(>>) :: Reverse m a -> Reverse m b -> Reverse m b #

return :: a -> Reverse m a #

Functor f => Functor (Reverse f) Source #

Derived instance.

Instance details

Defined in Data.Functor.Reverse

Methods

fmap :: (a -> b) -> Reverse f a -> Reverse f b #

(<$) :: a -> Reverse f b -> Reverse f a #

MonadFail m => MonadFail (Reverse m) Source # 
Instance details

Defined in Data.Functor.Reverse

Methods

fail :: String -> Reverse m a #

Applicative f => Applicative (Reverse f) Source #

Derived instance.

Instance details

Defined in Data.Functor.Reverse

Methods

pure :: a -> Reverse f a #

(<*>) :: Reverse f (a -> b) -> Reverse f a -> Reverse f b #

liftA2 :: (a -> b -> c) -> Reverse f a -> Reverse f b -> Reverse f c #

(*>) :: Reverse f a -> Reverse f b -> Reverse f b #

(<*) :: Reverse f a -> Reverse f b -> Reverse f a #

Foldable f => Foldable (Reverse f) Source #

Fold from right to left.

Instance details

Defined in Data.Functor.Reverse

Methods

fold :: Monoid m => Reverse f m -> m #

foldMap :: Monoid m => (a -> m) -> Reverse f a -> m #

foldMap' :: Monoid m => (a -> m) -> Reverse f a -> m #

foldr :: (a -> b -> b) -> b -> Reverse f a -> b #

foldr' :: (a -> b -> b) -> b -> Reverse f a -> b #

foldl :: (b -> a -> b) -> b -> Reverse f a -> b #

foldl' :: (b -> a -> b) -> b -> Reverse f a -> b #

foldr1 :: (a -> a -> a) -> Reverse f a -> a #

foldl1 :: (a -> a -> a) -> Reverse f a -> a #

toList :: Reverse f a -> [a] #

null :: Reverse f a -> Bool #

length :: Reverse f a -> Int #

elem :: Eq a => a -> Reverse f a -> Bool #

maximum :: Ord a => Reverse f a -> a #

minimum :: Ord a => Reverse f a -> a #

sum :: Num a => Reverse f a -> a #

product :: Num a => Reverse f a -> a #

Traversable f => Traversable (Reverse f) Source #

Traverse from right to left.

Instance details

Defined in Data.Functor.Reverse

Methods

traverse :: Applicative f0 => (a -> f0 b) -> Reverse f a -> f0 (Reverse f b) #

sequenceA :: Applicative f0 => Reverse f (f0 a) -> f0 (Reverse f a) #

mapM :: Monad m => (a -> m b) -> Reverse f a -> m (Reverse f b) #

sequence :: Monad m => Reverse f (m a) -> m (Reverse f a) #

Contravariant f => Contravariant (Reverse f) Source #

Derived instance.

Instance details

Defined in Data.Functor.Reverse

Methods

contramap :: (a -> b) -> Reverse f b -> Reverse f a #

(>$) :: b -> Reverse f b -> Reverse f a #

Eq1 f => Eq1 (Reverse f) Source # 
Instance details

Defined in Data.Functor.Reverse

Methods

liftEq :: (a -> b -> Bool) -> Reverse f a -> Reverse f b -> Bool #

Ord1 f => Ord1 (Reverse f) Source # 
Instance details

Defined in Data.Functor.Reverse

Methods

liftCompare :: (a -> b -> Ordering) -> Reverse f a -> Reverse f b -> Ordering #

Read1 f => Read1 (Reverse f) Source # 
Instance details

Defined in Data.Functor.Reverse

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Reverse f a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Reverse f a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Reverse f a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Reverse f a] #

Show1 f => Show1 (Reverse f) Source # 
Instance details

Defined in Data.Functor.Reverse

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Reverse f a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Reverse f a] -> ShowS #

Alternative f => Alternative (Reverse f) Source #

Derived instance.

Instance details

Defined in Data.Functor.Reverse

Methods

empty :: Reverse f a #

(<|>) :: Reverse f a -> Reverse f a -> Reverse f a #

some :: Reverse f a -> Reverse f [a] #

many :: Reverse f a -> Reverse f [a] #

MonadPlus m => MonadPlus (Reverse m) Source #

Derived instance.

Instance details

Defined in Data.Functor.Reverse

Methods

mzero :: Reverse m a #

mplus :: Reverse m a -> Reverse m a -> Reverse m a #

(Eq1 f, Eq a) => Eq (Reverse f a) Source # 
Instance details

Defined in Data.Functor.Reverse

Methods

(==) :: Reverse f a -> Reverse f a -> Bool #

(/=) :: Reverse f a -> Reverse f a -> Bool #

(Ord1 f, Ord a) => Ord (Reverse f a) Source # 
Instance details

Defined in Data.Functor.Reverse

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) Source # 
Instance details

Defined in Data.Functor.Reverse

(Show1 f, Show a) => Show (Reverse f a) Source # 
Instance details

Defined in Data.Functor.Reverse

Methods

showsPrec :: Int -> Reverse f a -> ShowS #

show :: Reverse f a -> String #

showList :: [Reverse f a] -> ShowS #

Generic (Reverse f a) Source # 
Instance details

Defined in Data.Functor.Reverse

Associated Types

type Rep (Reverse f a) :: Type -> Type #

Methods

from :: Reverse f a -> Rep (Reverse f a) x #

to :: Rep (Reverse f a) x -> Reverse f a #

type Rep1 (Reverse f :: k -> Type) Source # 
Instance details

Defined in Data.Functor.Reverse

type Rep1 (Reverse f :: k -> Type) = D1 ('MetaData "Reverse" "Data.Functor.Reverse" "transformers-0.6.0.4-6wgqQgktLayLloKShWoG1E" 'True) (C1 ('MetaCons "Reverse" 'PrefixI 'True) (S1 ('MetaSel ('Just "getReverse") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 f)))
type Rep (Reverse f a) Source # 
Instance details

Defined in Data.Functor.Reverse

type Rep (Reverse f a) = D1 ('MetaData "Reverse" "Data.Functor.Reverse" "transformers-0.6.0.4-6wgqQgktLayLloKShWoG1E" 'True) (C1 ('MetaCons "Reverse" 'PrefixI 'True) (S1 ('MetaSel ('Just "getReverse") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f a))))