base-4.9.1.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 #

Lifted product of functors.

Constructors

Pair (f a) (g a) 

Instances

(Monad f, Monad g) => Monad (Product * f g) # 

Methods

(>>=) :: Product * f g a -> (a -> Product * f g b) -> Product * f g b #

(>>) :: Product * f g a -> Product * f g b -> Product * f g b #

return :: a -> Product * f g a #

fail :: String -> Product * f g a #

(Functor f, Functor g) => Functor (Product * f g) # 

Methods

fmap :: (a -> b) -> Product * f g a -> Product * f g b #

(<$) :: a -> Product * f g b -> Product * f g a #

(MonadFix f, MonadFix g) => MonadFix (Product * f g) # 

Methods

mfix :: (a -> Product * f g a) -> Product * f g a #

(Applicative f, Applicative g) => Applicative (Product * f g) # 

Methods

pure :: a -> Product * f g a #

(<*>) :: Product * f g (a -> b) -> Product * f g a -> Product * f g b #

(*>) :: Product * f g a -> Product * f g b -> Product * f g b #

(<*) :: Product * f g a -> Product * f g b -> Product * f g a #

(Foldable f, Foldable g) => Foldable (Product * f g) # 

Methods

fold :: Monoid m => Product * f g m -> m #

foldMap :: Monoid m => (a -> m) -> Product * f g a -> m #

foldr :: (a -> b -> b) -> b -> Product * f g a -> b #

foldr' :: (a -> b -> b) -> b -> Product * f g a -> b #

foldl :: (b -> a -> b) -> b -> Product * f g a -> b #

foldl' :: (b -> a -> b) -> b -> Product * f g a -> b #

foldr1 :: (a -> a -> a) -> Product * f g a -> a #

foldl1 :: (a -> a -> a) -> Product * f g a -> a #

toList :: Product * f g a -> [a] #

null :: Product * f g a -> Bool #

length :: Product * f g a -> Int #

elem :: Eq a => a -> Product * f g a -> Bool #

maximum :: Ord a => Product * f g a -> a #

minimum :: Ord a => Product * f g a -> a #

sum :: Num a => Product * f g a -> a #

product :: Num a => Product * f g a -> a #

(Traversable f, Traversable g) => Traversable (Product * f g) # 

Methods

traverse :: Applicative f => (a -> f b) -> Product * f g a -> f (Product * f g b) #

sequenceA :: Applicative f => Product * f g (f a) -> f (Product * f g a) #

mapM :: Monad m => (a -> m b) -> Product * f g a -> m (Product * f g b) #

sequence :: Monad m => Product * f g (m a) -> m (Product * f g a) #

Generic1 (Product * f g) # 

Associated Types

type Rep1 (Product * f g :: * -> *) :: * -> * #

Methods

from1 :: Product * f g a -> Rep1 (Product * f g) a #

to1 :: Rep1 (Product * f g) a -> Product * f g a #

(MonadPlus f, MonadPlus g) => MonadPlus (Product * f g) # 

Methods

mzero :: Product * f g a #

mplus :: Product * f g a -> Product * f g a -> Product * f g a #

(Alternative f, Alternative g) => Alternative (Product * f g) # 

Methods

empty :: Product * f g a #

(<|>) :: Product * f g a -> Product * f g a -> Product * f g a #

some :: Product * f g a -> Product * f g [a] #

many :: Product * f g a -> Product * f g [a] #

(MonadZip f, MonadZip g) => MonadZip (Product * f g) # 

Methods

mzip :: Product * f g a -> Product * f g b -> Product * f g (a, b) #

mzipWith :: (a -> b -> c) -> Product * f g a -> Product * f g b -> Product * f g c #

munzip :: Product * f g (a, b) -> (Product * f g a, Product * f g b) #

(Show1 f, Show1 g) => Show1 (Product * f g) # 

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Product * f g a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Product * f g a] -> ShowS #

(Read1 f, Read1 g) => Read1 (Product * f g) # 

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Product * f g a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Product * f g a] #

(Ord1 f, Ord1 g) => Ord1 (Product * f g) # 

Methods

liftCompare :: (a -> b -> Ordering) -> Product * f g a -> Product * f g b -> Ordering #

(Eq1 f, Eq1 g) => Eq1 (Product * f g) # 

Methods

liftEq :: (a -> b -> Bool) -> Product * f g a -> Product * f g b -> Bool #

(Eq1 f, Eq1 g, Eq a) => Eq (Product * f g a) # 

Methods

(==) :: Product * f g a -> Product * f g a -> Bool Source #

(/=) :: Product * f g a -> Product * f g a -> Bool Source #

(Data (g a), Data (f a), Typeable * k, Typeable (k -> *) g, Typeable (k -> *) f, Typeable k a) => 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) #

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

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

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

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

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

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

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

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

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

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

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

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

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

(Ord1 f, Ord1 g, Ord a) => Ord (Product * f g a) # 

Methods

compare :: Product * f g a -> Product * f g a -> Ordering Source #

(<) :: Product * f g a -> Product * f g a -> Bool Source #

(<=) :: Product * f g a -> Product * f g a -> Bool Source #

(>) :: Product * f g a -> Product * f g a -> Bool Source #

(>=) :: Product * f g a -> Product * f g a -> Bool Source #

max :: Product * f g a -> Product * f g a -> Product * f g a Source #

min :: Product * f g a -> Product * f g a -> Product * f g a Source #

(Read1 f, Read1 g, Read a) => Read (Product * f g a) # 

Methods

readsPrec :: Int -> ReadS (Product * f g a) #

readList :: ReadS [Product * f g a] #

readPrec :: ReadPrec (Product * f g a) #

readListPrec :: ReadPrec [Product * f g a] #

(Show1 f, Show1 g, Show a) => Show (Product * f g a) # 

Methods

showsPrec :: Int -> Product * f g a -> ShowS #

show :: Product * f g a -> String #

showList :: [Product * f g a] -> ShowS #

Generic (Product k f g a) # 

Associated Types

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

Methods

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

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

type Rep1 (Product * f g) # 
type Rep (Product k f g a) #