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 |
Making functors whose elements are notionally in the reverse order from the original functor.
Synopsis
- newtype Reverse f a = Reverse {
- getReverse :: f a
Documentation
The same functor, but with Foldable
and Traversable
instances
that process the elements in the reverse order.
Reverse | |
|
Instances
Monad m => Monad (Reverse m) # | Derived instance. |
Functor f => Functor (Reverse f) # | Derived instance. |
MonadFail m => MonadFail (Reverse m) # | |
Applicative f => Applicative (Reverse f) # | Derived instance. |
Foldable f => Foldable (Reverse f) # | Fold from right to left. |
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 # | |
Traversable f => Traversable (Reverse f) # | Traverse from right to left. |
Eq1 f => Eq1 (Reverse f) # | |
Ord1 f => Ord1 (Reverse f) # | |
Read1 f => Read1 (Reverse f) # | |
liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Reverse f a) Source # liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Reverse f a] Source # liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Reverse f a) Source # liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Reverse f a] Source # | |
Show1 f => Show1 (Reverse f) # | |
Alternative f => Alternative (Reverse f) # | Derived instance. |
MonadPlus m => MonadPlus (Reverse m) # | Derived instance. |
(Eq1 f, Eq a) => Eq (Reverse f a) # | |
(Ord1 f, Ord a) => Ord (Reverse f a) # | |
(Read1 f, Read a) => Read (Reverse f a) # | |
(Show1 f, Show a) => Show (Reverse f a) # | |