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 | Haskell2010 |
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 |
Instances
(Foldable f, Foldable g) => Foldable (f :*: g) Source # | |
Defined in Data.Comp.Ops fold :: Monoid m => (f :*: g) m -> m # foldMap :: Monoid m => (a -> m) -> (f :*: g) a -> 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 # | |
(Functor f, Functor g) => Functor (f :*: g) Source # | |