Safe Haskell | Safe |
---|---|
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 # (<*>) :: Prod (f ': fs) (a -> b) -> Prod (f ': fs) a -> Prod (f ': fs) b # liftA2 :: (a -> b -> c) -> Prod (f ': fs) a -> Prod (f ': fs) b -> Prod (f ': fs) c # (*>) :: Prod (f ': fs) a -> Prod (f ': fs) b -> Prod (f ': fs) b # (<*) :: Prod (f ': fs) a -> Prod (f ': fs) b -> Prod (f ': fs) a # | |
Applicative (Prod ([] :: [Type -> Type])) Source # | Inductively defined instance: |
(Foldable f, Foldable (Prod fs)) => Foldable (Prod (f ': fs)) Source # | |
Defined in Data.Functor.Prod fold :: Monoid m => Prod (f ': fs) m -> m # foldMap :: Monoid m => (a -> m) -> Prod (f ': fs) a -> m # foldr :: (a -> b -> b) -> b -> Prod (f ': fs) a -> b # foldr' :: (a -> b -> b) -> b -> Prod (f ': fs) a -> b # foldl :: (b -> a -> b) -> b -> Prod (f ': fs) a -> b # foldl' :: (b -> a -> b) -> b -> Prod (f ': fs) a -> b # foldr1 :: (a -> a -> a) -> Prod (f ': fs) a -> a # foldl1 :: (a -> a -> a) -> Prod (f ': fs) a -> a # toList :: Prod (f ': fs) a -> [a] # null :: Prod (f ': fs) a -> Bool # length :: Prod (f ': fs) a -> Int # elem :: Eq a => a -> Prod (f ': fs) a -> Bool # maximum :: Ord a => Prod (f ': fs) a -> a # minimum :: Ord a => Prod (f ': fs) a -> a # | |
Foldable (Prod ([] :: [Type -> Type])) Source # | |
Defined in Data.Functor.Prod fold :: Monoid m => Prod [] m -> m # foldMap :: Monoid m => (a -> m) -> Prod [] a -> m # foldr :: (a -> b -> b) -> b -> Prod [] a -> b # foldr' :: (a -> b -> b) -> b -> Prod [] a -> b # foldl :: (b -> a -> b) -> b -> Prod [] a -> b # foldl' :: (b -> a -> b) -> b -> Prod [] a -> b # foldr1 :: (a -> a -> a) -> Prod [] a -> a # foldl1 :: (a -> a -> a) -> Prod [] a -> a # elem :: Eq a => a -> Prod [] a -> Bool # maximum :: Ord a => Prod [] a -> a # minimum :: Ord a => Prod [] a -> a # | |
(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) # sequenceA :: Applicative f0 => Prod (f ': fs) (f0 a) -> f0 (Prod (f ': fs) a) # mapM :: Monad m => (a -> m b) -> Prod (f ': fs) a -> m (Prod (f ': fs) b) # sequence :: Monad m => Prod (f ': fs) (m a) -> m (Prod (f ': fs) a) # | |
Traversable (Prod ([] :: [Type -> Type])) Source # | Inductively defined instance: |
(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 # (<) :: Prod (f ': fs) a -> Prod (f ': fs) a -> Bool # (<=) :: Prod (f ': fs) a -> Prod (f ': fs) a -> Bool # (>) :: Prod (f ': fs) a -> Prod (f ': fs) a -> Bool # (>=) :: Prod (f ': fs) a -> Prod (f ': fs) a -> Bool # max :: Prod (f ': fs) a -> Prod (f ': fs) a -> Prod (f ': fs) a # min :: Prod (f ': fs) a -> Prod (f ': fs) a -> Prod (f ': fs) a # | |
Ord a => Ord (Prod ([] :: [Type -> Type]) a) Source # | |
Defined in Data.Functor.Prod | |
(Show1 f, Show a, Show1 (Prod fs)) => Show (Prod (f ': fs) a) Source # | |
Show a => Show (Prod ([] :: [Type -> Type]) a) Source # | |