Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Deprecated: The module is no longer part of the main api and will be removed
Generalize the standard two-functor
Product
to the product of
n
-functors. Intuitively, this means:
Product
f g a ~~ (f a, g a)Prod
'[] a ~~ Const () aProd
'[f] a ~~ (f a)Prod
'[f, g] a ~~ (f a, g a)Prod
'[f, g, h] a ~~ (f a, g a, h a) ⋮
Synopsis
- data Prod :: [k -> Type ] -> k -> Type where
- zeroTuple :: Prod '[] a
- oneTuple :: f a -> Prod '[f] a
- fromProduct :: Product f g a -> Prod '[f, g] a
- toProduct :: Prod '[f, g] a -> Product f g a
- prod :: Prod ls a -> Prod rs a -> Prod (ls ++ rs) a
- uncurryn :: Curried ( Prod fs a -> r a) -> Prod fs a -> r a
- type family l ++ r :: [k] where ...
- type family Curried t where ...
n-tuples of functors.
data Prod :: [k -> Type ] -> k -> Type where Source #
Product of n functors.
Instances
( Functor f, Functor ( Prod fs)) => Functor ( Prod (f ': fs)) Source # | |
Functor ( Prod ('[] :: [ Type -> Type ])) Source # | |
( Applicative f, Applicative ( Prod fs)) => Applicative ( Prod (f ': fs)) Source # |
Inductively defined instance:
|
Defined in Data.Functor.Prod pure :: a -> Prod (f ': fs) a Source # (<*>) :: Prod (f ': fs) (a -> b) -> Prod (f ': fs) a -> Prod (f ': fs) b Source # liftA2 :: (a -> b -> c) -> Prod (f ': fs) a -> Prod (f ': fs) b -> Prod (f ': fs) c Source # (*>) :: Prod (f ': fs) a -> Prod (f ': fs) b -> Prod (f ': fs) b Source # (<*) :: Prod (f ': fs) a -> Prod (f ': fs) b -> Prod (f ': fs) a Source # |
|
Applicative ( Prod ('[] :: [ Type -> Type ])) Source # |
Inductively defined instance:
|
Defined in Data.Functor.Prod |
|
( Foldable f, Foldable ( Prod fs)) => Foldable ( Prod (f ': fs)) Source # | |
Defined in Data.Functor.Prod fold :: Monoid m => Prod (f ': fs) m -> m Source # foldMap :: Monoid m => (a -> m) -> Prod (f ': fs) a -> m Source # foldMap' :: Monoid m => (a -> m) -> Prod (f ': fs) a -> m Source # foldr :: (a -> b -> b) -> b -> Prod (f ': fs) a -> b Source # foldr' :: (a -> b -> b) -> b -> Prod (f ': fs) a -> b Source # foldl :: (b -> a -> b) -> b -> Prod (f ': fs) a -> b Source # foldl' :: (b -> a -> b) -> b -> Prod (f ': fs) a -> b Source # foldr1 :: (a -> a -> a) -> Prod (f ': fs) a -> a Source # foldl1 :: (a -> a -> a) -> Prod (f ': fs) a -> a Source # toList :: Prod (f ': fs) a -> [a] Source # null :: Prod (f ': fs) a -> Bool Source # length :: Prod (f ': fs) a -> Int Source # elem :: Eq a => a -> Prod (f ': fs) a -> Bool Source # maximum :: Ord a => Prod (f ': fs) a -> a Source # minimum :: Ord a => Prod (f ': fs) a -> a Source # |
|
Foldable ( Prod ('[] :: [ Type -> Type ])) Source # | |
Defined in Data.Functor.Prod fold :: Monoid m => Prod '[] m -> m Source # foldMap :: Monoid m => (a -> m) -> Prod '[] a -> m Source # foldMap' :: Monoid m => (a -> m) -> Prod '[] a -> m Source # foldr :: (a -> b -> b) -> b -> Prod '[] a -> b Source # foldr' :: (a -> b -> b) -> b -> Prod '[] a -> b Source # foldl :: (b -> a -> b) -> b -> Prod '[] a -> b Source # foldl' :: (b -> a -> b) -> b -> Prod '[] a -> b Source # foldr1 :: (a -> a -> a) -> Prod '[] a -> a Source # foldl1 :: (a -> a -> a) -> Prod '[] a -> a Source # toList :: Prod '[] a -> [a] Source # null :: Prod '[] a -> Bool Source # length :: Prod '[] a -> Int Source # elem :: Eq a => a -> Prod '[] a -> Bool Source # maximum :: Ord a => Prod '[] a -> a Source # minimum :: Ord a => Prod '[] a -> a Source # |
|
( Traversable f, Traversable ( Prod fs)) => Traversable ( Prod (f ': fs)) Source # |
Inductively defined instance:
|
Defined in Data.Functor.Prod traverse :: Applicative f0 => (a -> f0 b) -> Prod (f ': fs) a -> f0 ( Prod (f ': fs) b) Source # sequenceA :: Applicative f0 => Prod (f ': fs) (f0 a) -> f0 ( Prod (f ': fs) a) Source # mapM :: Monad m => (a -> m b) -> Prod (f ': fs) a -> m ( Prod (f ': fs) b) Source # sequence :: Monad m => Prod (f ': fs) (m a) -> m ( Prod (f ': fs) a) Source # |
|
Traversable ( Prod ('[] :: [ Type -> Type ])) Source # |
Inductively defined instance:
|
Defined in Data.Functor.Prod |
|
( Eq1 f, Eq1 ( Prod fs)) => Eq1 ( Prod (f ': fs)) Source # | |
Eq1 ( Prod ('[] :: [ Type -> Type ])) Source # | |
( Ord1 f, Ord1 ( Prod fs)) => Ord1 ( Prod (f ': fs)) Source # | |
Defined in Data.Functor.Prod |
|
Ord1 ( Prod ('[] :: [ Type -> Type ])) Source # | |
Defined in Data.Functor.Prod |
|
( Show1 f, Show1 ( Prod fs)) => Show1 ( Prod (f ': fs)) Source # | |
Show1 ( Prod ('[] :: [ Type -> Type ])) Source # | |
( Alternative f, Alternative ( Prod fs)) => Alternative ( Prod (f ': fs)) Source # |
Inductively defined instance:
|
Alternative ( Prod ('[] :: [ Type -> Type ])) Source # |
Inductively defined instance:
|
( Eq1 f, Eq a, Eq1 ( Prod fs)) => Eq ( Prod (f ': fs) a) Source # | |
Eq a => Eq ( Prod ('[] :: [ Type -> Type ]) a) Source # | |
( Ord1 f, Ord a, Ord1 ( Prod fs)) => Ord ( Prod (f ': fs) a) Source # | |
Defined in Data.Functor.Prod compare :: Prod (f ': fs) a -> Prod (f ': fs) a -> Ordering Source # (<) :: Prod (f ': fs) a -> Prod (f ': fs) a -> Bool Source # (<=) :: Prod (f ': fs) a -> Prod (f ': fs) a -> Bool Source # (>) :: Prod (f ': fs) a -> Prod (f ': fs) a -> Bool Source # (>=) :: Prod (f ': fs) a -> Prod (f ': fs) a -> Bool Source # max :: Prod (f ': fs) a -> Prod (f ': fs) a -> Prod (f ': fs) a Source # min :: Prod (f ': fs) a -> Prod (f ': fs) a -> Prod (f ': fs) a Source # |
|
Ord a => Ord ( Prod ('[] :: [ Type -> Type ]) a) Source # | |
Defined in Data.Functor.Prod compare :: Prod '[] a -> Prod '[] a -> Ordering Source # (<) :: Prod '[] a -> Prod '[] a -> Bool Source # (<=) :: Prod '[] a -> Prod '[] a -> Bool Source # (>) :: Prod '[] a -> Prod '[] a -> Bool Source # (>=) :: Prod '[] a -> Prod '[] a -> Bool Source # |
|
( Show1 f, Show a, Show1 ( Prod fs)) => Show ( Prod (f ': fs) a) Source # | |
Show a => Show ( Prod ('[] :: [ Type -> Type ]) a) Source # | |