fixplate-0.1.8: 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 # 
Instance details

Defined in Data.Generics.Fixplate.Functor

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

Defined in Data.Generics.Fixplate.Functor

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

Defined in Data.Generics.Fixplate.Functor

Methods

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

sequenceA :: Applicative f0 => (f :+: g) (f0 a) -> f0 ((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 # 
Instance details

Defined in Data.Generics.Fixplate.Functor

Methods

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

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

Defined in Data.Generics.Fixplate.Functor

Methods

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

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

Defined in Data.Generics.Fixplate.Functor

Methods

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

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

Defined in Data.Generics.Fixplate.Functor

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

Defined in Data.Generics.Fixplate.Functor

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

Defined in Data.Generics.Fixplate.Functor

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

Defined in Data.Generics.Fixplate.Functor

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

Defined in Data.Generics.Fixplate.Functor

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

Defined in Data.Generics.Fixplate.Functor

Methods

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

sequenceA :: Applicative f0 => (f :*: g) (f0 a) -> f0 ((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 # 
Instance details

Defined in Data.Generics.Fixplate.Functor

Methods

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

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

Defined in Data.Generics.Fixplate.Functor

Methods

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

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

Defined in Data.Generics.Fixplate.Functor

Methods

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

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

Defined in Data.Generics.Fixplate.Functor

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

Defined in Data.Generics.Fixplate.Functor

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

Defined in Data.Generics.Fixplate.Functor

Methods

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

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

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