Copyright | (c) 2014 Patrick Bahr |
---|---|
License | BSD3 |
Maintainer | Patrick Bahr <paba@di.ku.dk> |
Stability | experimental |
Portability | non-portable (GHC Extensions) |
Safe Haskell | Safe-Inferred |
Language | Haskell98 |
This module provides a generic projection function pr
for
arbitrary nested binary products.
Documentation
pr :: forall p q a. p :< q => q a -> p a Source
This function projects the component of type e
out or the
compound value of type p
.
type (:<) f g = Proj (ComprEmb (Elem f g)) f g infixl 5 Source
The constraint e :< p
expresses that e
is a component of the
type p
. That is, p
is formed by binary products using the type
e
. The occurrence of e
must be unique. For example we have Int
:< (Bool,(Int,Bool))
but not Bool :< (Bool,(Int,Bool))
.
data (f :*: g) a infixr 8 Source
Formal product of signatures (functors).
(f a) :*: (g a) infixr 8 |
(Functor f, Functor g) => Functor ((:*:) * f g) | |
(Foldable f, Foldable g) => Foldable ((:*:) * f g) | |
(Traversable f, Traversable g) => Traversable ((:*:) * f g) |