Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
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.
Documentation
data (f :+: g) a infixl 6 Source #
Sum of two functors
Instances
(Functor f, Functor g) => Functor (f :+: g) Source # | |
(Foldable f, Foldable g) => Foldable (f :+: g) Source # | |
Defined in Data.Generics.Fixplate.Functor 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] # 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 # | |
(Traversable f, Traversable g) => Traversable (f :+: g) Source # | |
Defined in Data.Generics.Fixplate.Functor | |
(ShowF f, ShowF g) => ShowF (f :+: g) Source # | |
Defined in Data.Generics.Fixplate.Functor | |
(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 # | |
Defined in Data.Generics.Fixplate.Functor | |
(Show (f a), Show (g a)) => Show ((f :+: g) a) Source # | |
data (f :*: g) a infixl 7 Source #
Product of two functors
(f a) :*: (g a) infixl 7 |
Instances
(Functor f, Functor g) => Functor (f :*: g) Source # | |
(Foldable f, Foldable g) => Foldable (f :*: g) Source # | |
Defined in Data.Generics.Fixplate.Functor 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] # 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 # | |
(Traversable f, Traversable g) => Traversable (f :*: g) Source # | |
Defined in Data.Generics.Fixplate.Functor | |
(ShowF f, ShowF g) => ShowF (f :*: g) Source # | |
Defined in Data.Generics.Fixplate.Functor | |
(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 # | |
Defined in Data.Generics.Fixplate.Functor | |
(Show (f a), Show (g a)) => Show ((f :*: g) a) Source # | |