fixplate-0.1.6: 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 
(Foldable f, Foldable g) => Foldable ((:+:) f g) Source 
(Traversable f, Traversable g) => Traversable ((:+:) f g) Source 
(ShowF f, ShowF g) => ShowF ((:+:) f g) Source 
(OrdF f, OrdF g) => OrdF ((:+:) f g) Source 
(EqF f, EqF g) => EqF ((:+:) f g) Source 
(Eq (f a), Eq (g a)) => Eq ((:+:) f g a) Source 
(Ord (f a), Ord (g a)) => Ord ((:+:) f g a) Source 
(Show (f a), Show (g a)) => Show ((:+:) f g a) Source 

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 
(Foldable f, Foldable g) => Foldable ((:*:) f g) Source 
(Traversable f, Traversable g) => Traversable ((:*:) f g) Source 
(ShowF f, ShowF g) => ShowF ((:*:) f g) Source 
(OrdF f, OrdF g) => OrdF ((:*:) f g) Source 
(EqF f, EqF g) => EqF ((:*:) f g) Source 
(Eq (f a), Eq (g a)) => Eq ((:*:) f g a) Source 
(Ord (f a), Ord (g a)) => Ord ((:*:) f g a) Source 
(Show (f a), Show (g a)) => Show ((:*:) f g a) Source