fixplate-0.1.7: Uniplate-style generic traversals for optionally annotated fixed-point types.

Safe HaskellSafe
LanguageHaskell2010

Data.Generics.Fixplate.Functor

Description

Sum and product functors, with the usual instances. You can in principle use these to extend existing expressions, for example

type ExtendedExpression = Mu (Expr :+: Custom)

This module uses the TypeOperators language extension for convenience.

Synopsis

Documentation

data (f :+: g) a infixl 6 Source #

Sum of two functors

Constructors

InL (f a) 
InR (g a) 

Instances

(Functor f, Functor g) => Functor ((:+:) f g) Source # 

Methods

fmap :: (a -> b) -> (f :+: g) a -> (f :+: g) b #

(<$) :: a -> (f :+: g) b -> (f :+: g) a #

(Foldable f, Foldable g) => Foldable ((:+:) f g) Source # 

Methods

fold :: Monoid m => (f :+: g) m -> m #

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

foldr :: (a -> b -> b) -> b -> (f :+: g) a -> b #

foldr' :: (a -> b -> b) -> b -> (f :+: g) a -> b #

foldl :: (b -> a -> b) -> b -> (f :+: g) a -> b #

foldl' :: (b -> a -> b) -> b -> (f :+: g) a -> b #

foldr1 :: (a -> a -> a) -> (f :+: g) a -> a #

foldl1 :: (a -> a -> a) -> (f :+: g) a -> a #

toList :: (f :+: g) a -> [a] #

null :: (f :+: g) a -> Bool #

length :: (f :+: g) a -> Int #

elem :: Eq a => a -> (f :+: g) a -> Bool #

maximum :: Ord a => (f :+: g) a -> a #

minimum :: Ord a => (f :+: g) a -> a #

sum :: Num a => (f :+: g) a -> a #

product :: Num a => (f :+: g) a -> a #

(Traversable f, Traversable g) => Traversable ((:+:) f g) Source # 

Methods

traverse :: Applicative f => (a -> f b) -> (f :+: g) a -> f ((f :+: g) b) #

sequenceA :: Applicative f => (f :+: g) (f a) -> f ((f :+: g) a) #

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

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

(ShowF f, ShowF g) => ShowF ((:+:) f g) Source # 

Methods

showsPrecF :: Show a => Int -> (f :+: g) a -> ShowS Source #

(OrdF f, OrdF g) => OrdF ((:+:) f g) Source # 

Methods

compareF :: Ord a => (f :+: g) a -> (f :+: g) a -> Ordering Source #

(EqF f, EqF g) => EqF ((:+:) f g) Source # 

Methods

equalF :: Eq a => (f :+: g) a -> (f :+: g) a -> Bool Source #

(Eq (f a), Eq (g a)) => Eq ((:+:) f g a) Source # 

Methods

(==) :: (f :+: g) a -> (f :+: g) a -> Bool #

(/=) :: (f :+: g) a -> (f :+: g) a -> Bool #

(Ord (f a), Ord (g a)) => Ord ((:+:) f g a) Source # 

Methods

compare :: (f :+: g) a -> (f :+: g) a -> Ordering #

(<) :: (f :+: g) a -> (f :+: g) a -> Bool #

(<=) :: (f :+: g) a -> (f :+: g) a -> Bool #

(>) :: (f :+: g) a -> (f :+: g) a -> Bool #

(>=) :: (f :+: g) a -> (f :+: g) a -> Bool #

max :: (f :+: g) a -> (f :+: g) a -> (f :+: g) a #

min :: (f :+: g) a -> (f :+: g) a -> (f :+: g) a #

(Show (f a), Show (g a)) => Show ((:+:) f g a) Source # 

Methods

showsPrec :: Int -> (f :+: g) a -> ShowS #

show :: (f :+: g) a -> String #

showList :: [(f :+: g) a] -> ShowS #

data (f :*: g) a infixl 7 Source #

Product of two functors

Constructors

(f a) :*: (g a) infixl 7 

Instances

(Functor f, Functor g) => Functor ((:*:) f g) Source # 

Methods

fmap :: (a -> b) -> (f :*: g) a -> (f :*: g) b #

(<$) :: a -> (f :*: g) b -> (f :*: g) a #

(Foldable f, Foldable g) => Foldable ((:*:) f g) Source # 

Methods

fold :: Monoid m => (f :*: g) m -> m #

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

foldr :: (a -> b -> b) -> b -> (f :*: g) a -> b #

foldr' :: (a -> b -> b) -> b -> (f :*: g) a -> b #

foldl :: (b -> a -> b) -> b -> (f :*: g) a -> b #

foldl' :: (b -> a -> b) -> b -> (f :*: g) a -> b #

foldr1 :: (a -> a -> a) -> (f :*: g) a -> a #

foldl1 :: (a -> a -> a) -> (f :*: g) a -> a #

toList :: (f :*: g) a -> [a] #

null :: (f :*: g) a -> Bool #

length :: (f :*: g) a -> Int #

elem :: Eq a => a -> (f :*: g) a -> Bool #

maximum :: Ord a => (f :*: g) a -> a #

minimum :: Ord a => (f :*: g) a -> a #

sum :: Num a => (f :*: g) a -> a #

product :: Num a => (f :*: g) a -> a #

(Traversable f, Traversable g) => Traversable ((:*:) f g) Source # 

Methods

traverse :: Applicative f => (a -> f b) -> (f :*: g) a -> f ((f :*: g) b) #

sequenceA :: Applicative f => (f :*: g) (f a) -> f ((f :*: g) a) #

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

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

(ShowF f, ShowF g) => ShowF ((:*:) f g) Source # 

Methods

showsPrecF :: Show a => Int -> (f :*: g) a -> ShowS Source #

(OrdF f, OrdF g) => OrdF ((:*:) f g) Source # 

Methods

compareF :: Ord a => (f :*: g) a -> (f :*: g) a -> Ordering Source #

(EqF f, EqF g) => EqF ((:*:) f g) Source # 

Methods

equalF :: Eq a => (f :*: g) a -> (f :*: g) a -> Bool Source #

(Eq (f a), Eq (g a)) => Eq ((:*:) f g a) Source # 

Methods

(==) :: (f :*: g) a -> (f :*: g) a -> Bool #

(/=) :: (f :*: g) a -> (f :*: g) a -> Bool #

(Ord (f a), Ord (g a)) => Ord ((:*:) f g a) Source # 

Methods

compare :: (f :*: g) a -> (f :*: g) a -> Ordering #

(<) :: (f :*: g) a -> (f :*: g) a -> Bool #

(<=) :: (f :*: g) a -> (f :*: g) a -> Bool #

(>) :: (f :*: g) a -> (f :*: g) a -> Bool #

(>=) :: (f :*: g) a -> (f :*: g) a -> Bool #

max :: (f :*: g) a -> (f :*: g) a -> (f :*: g) a #

min :: (f :*: g) a -> (f :*: g) a -> (f :*: g) a #

(Show (f a), Show (g a)) => Show ((:*:) f g a) Source # 

Methods

showsPrec :: Int -> (f :*: g) a -> ShowS #

show :: (f :*: g) a -> String #

showList :: [(f :*: g) a] -> ShowS #