Portability | non-portable (GHC Extensions) |
---|---|
Stability | experimental |
Maintainer | Patrick Bahr <paba@diku.dk> |
This module defines products on signatures.
- data (f :&: a) e = (f e) :&: a
- data (f :*: g) a = (f a) :*: (g a)
- class DistProd s p s' | s' -> s, s' -> p where
- class RemoveP s s' | s -> s' where
- removeP :: s a -> s' a
- liftP :: RemoveP s s' => (s' a -> t) -> s a -> t
- liftP' :: (DistProd s' p s, Functor s, Functor s') => (s' a -> Cxt h s' a) -> s a -> Cxt h s a
- stripP :: (Functor f, RemoveP g f, Functor g) => Cxt h g a -> Cxt h f a
- productTermHom :: (DistProd f p f', DistProd g p g', Functor g, Functor g') => TermHom f g -> TermHom f' g'
- constP :: (DistProd f p g, Functor f, Functor g) => p -> Cxt h f a -> Cxt h g a
- project' :: (s :<: f, RemoveP s s') => Cxt h f a -> Maybe (s' (Cxt h f a))
Documentation
This data type adds a constant product to a signature.
(f e) :&: a |
DistProd f p (:&: f p) | |
Functor f => Functor (:&: f a) | |
Foldable f => Foldable (:&: f a) | |
Traversable f => Traversable (:&: f a) | |
(ShowF f, Show p) => ShowF (:&: f p) | |
(ArbitraryF f, Arbitrary p) => ArbitraryF (:&: f p) | |
RemoveP (:&: f p) f | |
DistProd s p s' => DistProd (:+: f s) p (:+: (:&: f p) s') | |
RemoveP s s' => RemoveP (:+: (:&: f p) s) (:+: f s') |
class DistProd s p s' | s' -> s, s' -> p whereSource
This class defines how to distribute a product over a sum of signatures.
liftP :: RemoveP s s' => (s' a -> t) -> s a -> tSource
Transform a function with a domain constructed from a functor to a function with a domain constructed with the same functor, but with an additional product.
liftP' :: (DistProd s' p s, Functor s, Functor s') => (s' a -> Cxt h s' a) -> s a -> Cxt h s aSource
Transform a function with a domain constructed from a functor to a function with a domain constructed with the same functor, but with an additional product.
stripP :: (Functor f, RemoveP g f, Functor g) => Cxt h g a -> Cxt h f aSource
Strip the products from a term over a functor with products.
productTermHom :: (DistProd f p f', DistProd g p g', Functor g, Functor g') => TermHom f g -> TermHom f' g'Source
Lift a term homomorphism over signatures f
and g
to a term homomorphism
over the same signatures, but extended with products.