base-4.9.0.0: Basic libraries

Copyright(c) Ross Paterson 2010
LicenseBSD-style (see the file LICENSE)
Maintainerlibraries@haskell.org
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Data.Functor.Product

Description

Products, lifted to functors.

Since: 4.9.0.0

Synopsis

Documentation

data Product f g a Source

Lifted product of functors.

Constructors

Pair (f a) (g a) 

Instances

(Monad f, Monad g) => Monad (Product (TYPE Lifted) f g) 

Methods

(>>=) :: Product (TYPE Lifted) f g a -> (a -> Product (TYPE Lifted) f g b) -> Product (TYPE Lifted) f g b Source

(>>) :: Product (TYPE Lifted) f g a -> Product (TYPE Lifted) f g b -> Product (TYPE Lifted) f g b Source

return :: a -> Product (TYPE Lifted) f g a Source

fail :: String -> Product (TYPE Lifted) f g a Source

(Functor f, Functor g) => Functor (Product (TYPE Lifted) f g) 

Methods

fmap :: (a -> b) -> Product (TYPE Lifted) f g a -> Product (TYPE Lifted) f g b Source

(<$) :: a -> Product (TYPE Lifted) f g b -> Product (TYPE Lifted) f g a Source

(MonadFix f, MonadFix g) => MonadFix (Product (TYPE Lifted) f g) 

Methods

mfix :: (a -> Product (TYPE Lifted) f g a) -> Product (TYPE Lifted) f g a Source

(Applicative f, Applicative g) => Applicative (Product (TYPE Lifted) f g) 

Methods

pure :: a -> Product (TYPE Lifted) f g a Source

(<*>) :: Product (TYPE Lifted) f g (a -> b) -> Product (TYPE Lifted) f g a -> Product (TYPE Lifted) f g b Source

(*>) :: Product (TYPE Lifted) f g a -> Product (TYPE Lifted) f g b -> Product (TYPE Lifted) f g b Source

(<*) :: Product (TYPE Lifted) f g a -> Product (TYPE Lifted) f g b -> Product (TYPE Lifted) f g a Source

(Foldable f, Foldable g) => Foldable (Product (TYPE Lifted) f g) 

Methods

fold :: Monoid m => Product (TYPE Lifted) f g m -> m Source

foldMap :: Monoid m => (a -> m) -> Product (TYPE Lifted) f g a -> m Source

foldr :: (a -> b -> b) -> b -> Product (TYPE Lifted) f g a -> b Source

foldr' :: (a -> b -> b) -> b -> Product (TYPE Lifted) f g a -> b Source

foldl :: (b -> a -> b) -> b -> Product (TYPE Lifted) f g a -> b Source

foldl' :: (b -> a -> b) -> b -> Product (TYPE Lifted) f g a -> b Source

foldr1 :: (a -> a -> a) -> Product (TYPE Lifted) f g a -> a Source

foldl1 :: (a -> a -> a) -> Product (TYPE Lifted) f g a -> a Source

toList :: Product (TYPE Lifted) f g a -> [a] Source

null :: Product (TYPE Lifted) f g a -> Bool Source

length :: Product (TYPE Lifted) f g a -> Int Source

elem :: Eq a => a -> Product (TYPE Lifted) f g a -> Bool Source

maximum :: Ord a => Product (TYPE Lifted) f g a -> a Source

minimum :: Ord a => Product (TYPE Lifted) f g a -> a Source

sum :: Num a => Product (TYPE Lifted) f g a -> a Source

product :: Num a => Product (TYPE Lifted) f g a -> a Source

(Traversable f, Traversable g) => Traversable (Product (TYPE Lifted) f g) 

Methods

traverse :: Applicative f => (a -> f b) -> Product (TYPE Lifted) f g a -> f (Product (TYPE Lifted) f g b) Source

sequenceA :: Applicative f => Product (TYPE Lifted) f g (f a) -> f (Product (TYPE Lifted) f g a) Source

mapM :: Monad m => (a -> m b) -> Product (TYPE Lifted) f g a -> m (Product (TYPE Lifted) f g b) Source

sequence :: Monad m => Product (TYPE Lifted) f g (m a) -> m (Product (TYPE Lifted) f g a) Source

Generic1 (Product (TYPE Lifted) f g) 

Associated Types

type Rep1 (Product (TYPE Lifted) f g :: * -> TYPE Lifted) :: * -> * Source

Methods

from1 :: Product (TYPE Lifted) f g a -> Rep1 (Product (TYPE Lifted) f g) a Source

to1 :: Rep1 (Product (TYPE Lifted) f g) a -> Product (TYPE Lifted) f g a Source

(MonadPlus f, MonadPlus g) => MonadPlus (Product (TYPE Lifted) f g) 

Methods

mzero :: Product (TYPE Lifted) f g a Source

mplus :: Product (TYPE Lifted) f g a -> Product (TYPE Lifted) f g a -> Product (TYPE Lifted) f g a Source

(Alternative f, Alternative g) => Alternative (Product (TYPE Lifted) f g) 

Methods

empty :: Product (TYPE Lifted) f g a Source

(<|>) :: Product (TYPE Lifted) f g a -> Product (TYPE Lifted) f g a -> Product (TYPE Lifted) f g a Source

some :: Product (TYPE Lifted) f g a -> Product (TYPE Lifted) f g [a] Source

many :: Product (TYPE Lifted) f g a -> Product (TYPE Lifted) f g [a] Source

(MonadZip f, MonadZip g) => MonadZip (Product (TYPE Lifted) f g) 

Methods

mzip :: Product (TYPE Lifted) f g a -> Product (TYPE Lifted) f g b -> Product (TYPE Lifted) f g (a, b) Source

mzipWith :: (a -> b -> c) -> Product (TYPE Lifted) f g a -> Product (TYPE Lifted) f g b -> Product (TYPE Lifted) f g c Source

munzip :: Product (TYPE Lifted) f g (a, b) -> (Product (TYPE Lifted) f g a, Product (TYPE Lifted) f g b) Source

(Show1 f, Show1 g) => Show1 (Product (TYPE Lifted) f g) 

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Product (TYPE Lifted) f g a -> ShowS Source

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Product (TYPE Lifted) f g a] -> ShowS Source

(Read1 f, Read1 g) => Read1 (Product (TYPE Lifted) f g) 

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Product (TYPE Lifted) f g a) Source

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Product (TYPE Lifted) f g a] Source

(Ord1 f, Ord1 g) => Ord1 (Product (TYPE Lifted) f g) 

Methods

liftCompare :: (a -> b -> Ordering) -> Product (TYPE Lifted) f g a -> Product (TYPE Lifted) f g b -> Ordering Source

(Eq1 f, Eq1 g) => Eq1 (Product (TYPE Lifted) f g) 

Methods

liftEq :: (a -> b -> Bool) -> Product (TYPE Lifted) f g a -> Product (TYPE Lifted) f g b -> Bool Source

(Eq1 f, Eq1 g, Eq a) => Eq (Product (TYPE Lifted) f g a) 

Methods

(==) :: Product (TYPE Lifted) f g a -> Product (TYPE Lifted) f g a -> Bool Source

(/=) :: Product (TYPE Lifted) f g a -> Product (TYPE Lifted) f g a -> Bool Source

(Data (f a), Data (g a), Typeable k a, Typeable (TYPE Lifted) k, Typeable (k -> TYPE Lifted) f, Typeable (k -> TYPE Lifted) g) => Data (Product k f g a) 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall b. b -> c b) -> Product k f g a -> c (Product k f g a) Source

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Product k f g a) Source

toConstr :: Product k f g a -> Constr Source

dataTypeOf :: Product k f g a -> DataType Source

dataCast1 :: Typeable (TYPE Lifted -> TYPE Lifted) t => (forall d. Data d => c (t d)) -> Maybe (c (Product k f g a)) Source

dataCast2 :: Typeable (TYPE Lifted -> TYPE Lifted -> TYPE Lifted) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Product k f g a)) Source

gmapT :: (forall b. Data b => b -> b) -> Product k f g a -> Product k f g a Source

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Product k f g a -> r Source

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Product k f g a -> r Source

gmapQ :: (forall d. Data d => d -> u) -> Product k f g a -> [u] Source

gmapQi :: Int -> (forall d. Data d => d -> u) -> Product k f g a -> u Source

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Product k f g a -> m (Product k f g a) Source

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Product k f g a -> m (Product k f g a) Source

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Product k f g a -> m (Product k f g a) Source

(Ord1 f, Ord1 g, Ord a) => Ord (Product (TYPE Lifted) f g a) 

Methods

compare :: Product (TYPE Lifted) f g a -> Product (TYPE Lifted) f g a -> Ordering Source

(<) :: Product (TYPE Lifted) f g a -> Product (TYPE Lifted) f g a -> Bool Source

(<=) :: Product (TYPE Lifted) f g a -> Product (TYPE Lifted) f g a -> Bool Source

(>) :: Product (TYPE Lifted) f g a -> Product (TYPE Lifted) f g a -> Bool Source

(>=) :: Product (TYPE Lifted) f g a -> Product (TYPE Lifted) f g a -> Bool Source

max :: Product (TYPE Lifted) f g a -> Product (TYPE Lifted) f g a -> Product (TYPE Lifted) f g a Source

min :: Product (TYPE Lifted) f g a -> Product (TYPE Lifted) f g a -> Product (TYPE Lifted) f g a Source

(Read1 f, Read1 g, Read a) => Read (Product (TYPE Lifted) f g a) 
(Show1 f, Show1 g, Show a) => Show (Product (TYPE Lifted) f g a) 
Generic (Product k f g a) 

Associated Types

type Rep (Product k f g a) :: * -> * Source

Methods

from :: Product k f g a -> Rep (Product k f g a) x Source

to :: Rep (Product k f g a) x -> Product k f g a Source

type Rep1 (Product k f g) = D1 (MetaData "Product" "Data.Functor.Product" "base" False) (C1 (MetaCons "Pair" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec1 f)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec1 g)))) 
type Rep (Product k f g a) = D1 (MetaData "Product" "Data.Functor.Product" "base" False) (C1 (MetaCons "Pair" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (f a))) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (g a)))))