monoidal-functors-0.2.3.0: Monoidal Functors Library
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Functor.Monoidal

Synopsis

Semigroupal

class (Associative cat t1, Associative cat t0) => Semigroupal cat t1 t0 f where Source #

Given monoidal categories \((\mathcal{C}, \otimes, I_{\mathcal{C}})\) and \((\mathcal{D}, \bullet, I_{\mathcal{D}})\). A functor \(F : \mathcal{C} \to \mathcal{D}\) is Semigroupal if it supports a natural transformation \(\phi_{A,B} : F\ A \bullet F\ B \to F\ (A \otimes B)\), which we call combine.

Laws

Associativity:

\[ \require{AMScd} \begin{CD} (F A \bullet F B) \bullet F C @>>{\alpha_{\mathcal{D}}}> F A \bullet (F B \bullet F C) \\ @VV{\phi_{A,B} \bullet 1}V @VV{1 \bullet \phi_{B,C}}V \\ F (A \otimes B) \bullet F C @. F A \bullet (F (B \otimes C)) \\ @VV{\phi_{A \otimes B,C}}V @VV{\phi_{A,B \otimes C}}V \\ F ((A \otimes B) \otimes C) @>>{F \alpha_{\mathcal{C}}}> F (A \otimes (B \otimes C)) \\ \end{CD} \]

combine . grmap combine . bwd assocfmap (bwd assoc) . combine . glmap combine

Methods

combine :: (f x `t0` f x') `cat` f (x `t1` x') Source #

combine is a natural transformation from functors \(\mathcal{C} × \mathcal{C}\) to \(\mathcal{D}\).

Examples

Expand
>>> combine @(->) @(,) @(,) @Maybe (Just True, Just "hello")
Just (True,"hello")
>>> combine @(->) @(,) @(,) @Maybe (Just True, Nothing)
Nothing
>>> combine @(->) @Either @(,) @Maybe (Just True, Nothing)
Just (Left True)
>>> combine @(->) @Either @(,) @Maybe (Nothing, Just "hello")
Just (Right "hello")

Instances

Instances details
Semigroupal Op Either Either Identity Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: Op (Either (Identity x) (Identity x')) (Identity (Either x x')) Source #

Semigroupal (->) Either (,) ZipList Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (ZipList x, ZipList x') -> ZipList (Either x x') Source #

Semigroupal (->) Either (,) Comparison Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (Comparison x, Comparison x') -> Comparison (Either x x') Source #

Semigroupal (->) Either (,) Equivalence Source # 
Instance details

Defined in Data.Functor.Monoidal

Semigroupal (->) Either (,) Predicate Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (Predicate x, Predicate x') -> Predicate (Either x x') Source #

Semigroupal (->) Either (,) STM Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (STM x, STM x') -> STM (Either x x') Source #

Semigroupal (->) Either (,) ReadP Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (ReadP x, ReadP x') -> ReadP (Either x x') Source #

Semigroupal (->) Either (,) ReadPrec Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (ReadPrec x, ReadPrec x') -> ReadPrec (Either x x') Source #

Semigroupal (->) Either (,) IO Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (IO x, IO x') -> IO (Either x x') Source #

Semigroupal (->) Either (,) Maybe Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (Maybe x, Maybe x') -> Maybe (Either x x') Source #

Semigroupal (->) Either (,) [] Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: ([x], [x']) -> [Either x x'] Source #

Semigroupal (->) These (,) ZipList Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (ZipList x, ZipList x') -> ZipList (These x x') Source #

Semigroupal (->) These (,) Identity Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (Identity x, Identity x') -> Identity (These x x') Source #

Semigroupal (->) These (,) NonEmpty Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (NonEmpty x, NonEmpty x') -> NonEmpty (These x x') Source #

Semigroupal (->) These (,) Maybe Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (Maybe x, Maybe x') -> Maybe (These x x') Source #

Semigroupal (->) These (,) [] Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: ([x], [x']) -> [These x x'] Source #

Semigroupal (->) (,) (,) ZipList Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (ZipList x, ZipList x') -> ZipList (x, x') Source #

Semigroupal (->) (,) (,) Comparison Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (Comparison x, Comparison x') -> Comparison (x, x') Source #

Semigroupal (->) (,) (,) Equivalence Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (Equivalence x, Equivalence x') -> Equivalence (x, x') Source #

Semigroupal (->) (,) (,) Predicate Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (Predicate x, Predicate x') -> Predicate (x, x') Source #

Semigroupal (->) (,) (,) Identity Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (Identity x, Identity x') -> Identity (x, x') Source #

Semigroupal (->) (,) (,) IO Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (IO x, IO x') -> IO (x, x') Source #

Semigroupal (->) (,) (,) NonEmpty Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (NonEmpty x, NonEmpty x') -> NonEmpty (x, x') Source #

Semigroupal (->) (,) (,) Maybe Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (Maybe x, Maybe x') -> Maybe (x, x') Source #

Semigroupal (->) (,) (,) [] Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: ([x], [x']) -> [(x, x')] Source #

MonadPlus m => Semigroupal (->) Either (,) (WrappedMonad m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (WrappedMonad m x, WrappedMonad m x') -> WrappedMonad m (Either x x') Source #

ArrowPlus a => Semigroupal (->) Either (,) (ArrowMonad a) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (ArrowMonad a x, ArrowMonad a x') -> ArrowMonad a (Either x x') Source #

Monoid r => Semigroupal (->) Either (,) (Op r) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (Op r x, Op r x') -> Op r (Either x x') Source #

Semigroupal (->) Either (,) (Proxy :: Type -> Type) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (Proxy x, Proxy x') -> Proxy (Either x x') Source #

Semigroupal (->) Either (,) (U1 :: Type -> Type) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (U1 x, U1 x') -> U1 (Either x x') Source #

Decidable m => Semigroupal (->) Either (,) (MaybeT m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (MaybeT m x, MaybeT m x') -> MaybeT m (Either x x') Source #

Semigroupal (->) These (,) (Proxy :: Type -> Type) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (Proxy x, Proxy x') -> Proxy (These x x') Source #

Semigroupal (->) (,) (,) (Either e) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (Either e x, Either e x') -> Either e (x, x') Source #

Monoid r => Semigroupal (->) (,) (,) (Op r) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (Op r x, Op r x') -> Op r (x, x') Source #

Semigroupal (->) (,) (,) (Proxy :: Type -> Type) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (Proxy x, Proxy x') -> Proxy (x, x') Source #

Semigroupal (->) (,) (,) (U1 :: Type -> Type) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (U1 x, U1 x') -> U1 (x, x') Source #

Divisible m => Semigroupal (->) (,) (,) (MaybeT m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (MaybeT m x, MaybeT m x') -> MaybeT m (x, x') Source #

Monoid x1 => Semigroupal (->) (,) (,) ((,) x1) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: ((x1, x), (x1, x')) -> (x1, (x, x')) Source #

(ArrowZero a, ArrowPlus a) => Semigroupal (->) Either (,) (WrappedArrow a b) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (WrappedArrow a b x, WrappedArrow a b x') -> WrappedArrow a b (Either x x') Source #

Alternative m => Semigroupal (->) Either (,) (Kleisli m a) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (Kleisli m a x, Kleisli m a x') -> Kleisli m a (Either x x') Source #

Alternative f => Semigroupal (->) Either (,) (Ap f) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (Ap f x, Ap f x') -> Ap f (Either x x') Source #

Alternative f => Semigroupal (->) Either (,) (Alt f) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (Alt f x, Alt f x') -> Alt f (Either x x') Source #

Alternative f => Semigroupal (->) Either (,) (Rec1 f) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (Rec1 f x, Rec1 f x') -> Rec1 f (Either x x') Source #

(Decidable g, Applicative f) => Semigroupal (->) Either (,) (ComposeFC f g) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (ComposeFC f g x, ComposeFC f g x') -> ComposeFC f g (Either x x') Source #

Decidable f => Semigroupal (->) Either (,) (Backwards f) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (Backwards f x, Backwards f x') -> Backwards f (Either x x') Source #

Decidable m => Semigroupal (->) Either (,) (IdentityT m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (IdentityT m x, IdentityT m x') -> IdentityT m (Either x x') Source #

Decidable m => Semigroupal (->) Either (,) (ReaderT r m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (ReaderT r m x, ReaderT r m x') -> ReaderT r m (Either x x') Source #

Decidable m => Semigroupal (->) Either (,) (StateT w m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (StateT w m x, StateT w m x') -> StateT w m (Either x x') Source #

Decidable m => Semigroupal (->) Either (,) (StateT w m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (StateT w m x, StateT w m x') -> StateT w m (Either x x') Source #

Decidable m => Semigroupal (->) Either (,) (WriterT w m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (WriterT w m x, WriterT w m x') -> WriterT w m (Either x x') Source #

Decidable m => Semigroupal (->) Either (,) (WriterT w m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (WriterT w m x, WriterT w m x') -> WriterT w m (Either x x') Source #

Decidable f => Semigroupal (->) Either (,) (Reverse f) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (Reverse f x, Reverse f x') -> Reverse f (Either x x') Source #

Semigroupal (->) These (,) (Tagged b) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (Tagged b x, Tagged b x') -> Tagged b (These x x') Source #

Monoid m => Semigroupal (->) (,) (,) (Const m :: Type -> Type) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (Const m x, Const m x') -> Const m (x, x') Source #

Divisible f => Semigroupal (->) (,) (,) (Alt f) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (Alt f x, Alt f x') -> Alt f (x, x') Source #

Divisible m => Semigroupal (->) (,) (,) (Rec1 m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (Rec1 m x, Rec1 m x') -> Rec1 m (x, x') Source #

(Divisible f, Applicative g) => Semigroupal (->) (,) (,) (ComposeCF f g) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (ComposeCF f g x, ComposeCF f g x') -> ComposeCF f g (x, x') Source #

(Divisible g, Applicative f) => Semigroupal (->) (,) (,) (ComposeFC f g) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (ComposeFC f g x, ComposeFC f g x') -> ComposeFC f g (x, x') Source #

Divisible f => Semigroupal (->) (,) (,) (Backwards f) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (Backwards f x, Backwards f x') -> Backwards f (x, x') Source #

Divisible m => Semigroupal (->) (,) (,) (ExceptT e m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (ExceptT e m x, ExceptT e m x') -> ExceptT e m (x, x') Source #

Divisible m => Semigroupal (->) (,) (,) (IdentityT m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (IdentityT m x, IdentityT m x') -> IdentityT m (x, x') Source #

Divisible m => Semigroupal (->) (,) (,) (ReaderT r m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (ReaderT r m x, ReaderT r m x') -> ReaderT r m (x, x') Source #

Divisible m => Semigroupal (->) (,) (,) (StateT w m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (StateT w m x, StateT w m x') -> StateT w m (x, x') Source #

Divisible m => Semigroupal (->) (,) (,) (StateT w m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (StateT w m x, StateT w m x') -> StateT w m (x, x') Source #

Divisible m => Semigroupal (->) (,) (,) (WriterT w m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (WriterT w m x, WriterT w m x') -> WriterT w m (x, x') Source #

Divisible m => Semigroupal (->) (,) (,) (WriterT w m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (WriterT w m x, WriterT w m x') -> WriterT w m (x, x') Source #

Monoid m => Semigroupal (->) (,) (,) (Constant m :: Type -> Type) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (Constant m x, Constant m x') -> Constant m (x, x') Source #

Divisible f => Semigroupal (->) (,) (,) (Reverse f) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (Reverse f x, Reverse f x') -> Reverse f (x, x') Source #

(Monoid x1, Monoid x2) => Semigroupal (->) (,) (,) ((,,) x1 x2) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: ((x1, x2, x), (x1, x2, x')) -> (x1, x2, (x, x')) Source #

(Alternative f, Alternative g) => Semigroupal (->) Either (,) (Product f g) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (Product f g x, Product f g x') -> Product f g (Either x x') Source #

(Alternative f, Alternative g) => Semigroupal (->) Either (,) (f :*: g) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: ((f :*: g) x, (f :*: g) x') -> (f :*: g) (Either x x') Source #

(Semialign f, Semialign g) => Semigroupal (->) These (,) (Product f g) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (Product f g x, Product f g x') -> Product f g (These x x') Source #

(Applicative f, Applicative g) => Semigroupal (->) (,) (,) (Product f g) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (Product f g x, Product f g x') -> Product f g (x, x') Source #

(Divisible f, Divisible g) => Semigroupal (->) (,) (,) (f :*: g) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: ((f :*: g) x, (f :*: g) x') -> (f :*: g) (x, x') Source #

(Monoid x1, Monoid x2, Monoid x3) => Semigroupal (->) (,) (,) ((,,,) x1 x2 x3) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: ((x1, x2, x3, x), (x1, x2, x3, x')) -> (x1, x2, x3, (x, x')) Source #

(Alternative f, Applicative g) => Semigroupal (->) Either (,) (Compose f g) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (Compose f g x, Compose f g x') -> Compose f g (Either x x') Source #

(Alternative f, Applicative g) => Semigroupal (->) Either (,) (f :.: g) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: ((f :.: g) x, (f :.: g) x') -> (f :.: g) (Either x x') Source #

Alternative f => Semigroupal (->) Either (,) (M1 i c f) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (M1 i c f x, M1 i c f x') -> M1 i c f (Either x x') Source #

Decidable m => Semigroupal (->) Either (,) (RWST r w s m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (RWST r w s m x, RWST r w s m x') -> RWST r w s m (Either x x') Source #

Decidable m => Semigroupal (->) Either (,) (RWST r w s m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (RWST r w s m x, RWST r w s m x') -> RWST r w s m (Either x x') Source #

(Semialign f, Semialign g) => Semigroupal (->) These (,) (Compose f g) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (Compose f g x, Compose f g x') -> Compose f g (These x x') Source #

(Applicative f, Applicative g) => Semigroupal (->) (,) (,) (Compose f g) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (Compose f g x, Compose f g x') -> Compose f g (x, x') Source #

(Applicative f, Divisible g) => Semigroupal (->) (,) (,) (f :.: g) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: ((f :.: g) x, (f :.: g) x') -> (f :.: g) (x, x') Source #

Divisible f => Semigroupal (->) (,) (,) (M1 i c f) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (M1 i c f x, M1 i c f x') -> M1 i c f (x, x') Source #

Divisible m => Semigroupal (->) (,) (,) (RWST r w s m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (RWST r w s m x, RWST r w s m x') -> RWST r w s m (x, x') Source #

Divisible m => Semigroupal (->) (,) (,) (RWST r w s m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

combine :: (RWST r w s m x, RWST r w s m x') -> RWST r w s m (x, x') Source #

(|?|) :: Semigroupal (->) t1 (,) f => f a -> f b -> f (a `t1` b) infixr 9 Source #

(|*|) :: Semigroupal (->) (,) (,) f => f a -> f b -> f (a, b) infixr 4 Source #

type (|*|) = (,) infixr 4 Source #

(|+|) :: Semigroupal (->) Either (,) f => f a -> f b -> f (Either a b) infixr 3 Source #

type (|+|) = Either infixr 3 Source #

(|&|) :: Semigroupal (->) These (,) f => f a -> f b -> f (These a b) infixr 3 Source #

type (|&|) = These infixr 3 Source #

Unital

class Unital cat i1 i0 f where Source #

Given monoidal categories \((\mathcal{C}, \otimes, I_{\mathcal{C}})\) and \((\mathcal{D}, \bullet, I_{\mathcal{D}})\). A functor \(F : \mathcal{C} \to \mathcal{D}\) is Unital if it supports a morphism \(\phi : I_{\mathcal{D}} \to F\ I_{\mathcal{C}}\), which we call introduce.

Methods

introduce :: cat i0 (f i1) Source #

introduce maps from the identity in \(\mathcal{C}\) to the identity in \(\mathcal{D}\).

Examples

Expand
>>> introduce @(->) @() @() @Maybe ()
Just ()
>>> :t introduce @(->) @Void @() @Maybe
introduce @(->) @Void @() @Maybe :: () -> Maybe Void
>>> introduce @(->) @Void @() @Maybe ()
Nothing

Instances

Instances details
Unital (->) Void () ZipList Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> ZipList Void Source #

Unital (->) Void () Comparison Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> Comparison Void Source #

Unital (->) Void () Equivalence Source # 
Instance details

Defined in Data.Functor.Monoidal

Unital (->) Void () Predicate Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> Predicate Void Source #

Unital (->) Void () STM Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> STM Void Source #

Unital (->) Void () ReadP Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> ReadP Void Source #

Unital (->) Void () ReadPrec Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> ReadPrec Void Source #

Unital (->) Void () IO Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> IO Void Source #

Unital (->) Void () Maybe Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> Maybe Void Source #

Unital (->) Void () [] Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> [Void] Source #

Unital (->) () () ZipList Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> ZipList () Source #

Unital (->) () () Comparison Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> Comparison () Source #

Unital (->) () () Equivalence Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> Equivalence () Source #

Unital (->) () () Predicate Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> Predicate () Source #

Unital (->) () () Identity Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> Identity () Source #

Unital (->) () () IO Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> IO () Source #

Unital (->) () () NonEmpty Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> NonEmpty () Source #

Unital (->) () () Maybe Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> Maybe () Source #

Unital (->) () () [] Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> [()] Source #

MonadPlus m => Unital (->) Void () (WrappedMonad m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> WrappedMonad m Void Source #

ArrowPlus a => Unital (->) Void () (ArrowMonad a) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> ArrowMonad a Void Source #

Monoid r => Unital (->) Void () (Op r) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> Op r Void Source #

Unital (->) Void () (Proxy :: Type -> Type) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> Proxy Void Source #

Unital (->) Void () (U1 :: Type -> Type) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> U1 Void Source #

Decidable m => Unital (->) Void () (MaybeT m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> MaybeT m Void Source #

Unital (->) () () (Either e) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> Either e () Source #

Monoid r => Unital (->) () () (Op r) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> Op r () Source #

Unital (->) () () (U1 :: Type -> Type) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> U1 () Source #

Divisible m => Unital (->) () () (MaybeT m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> MaybeT m () Source #

Monoid x1 => Unital (->) () () ((,) x1) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> (x1, ()) Source #

(ArrowZero a, ArrowPlus a) => Unital (->) Void () (WrappedArrow a b) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> WrappedArrow a b Void Source #

Alternative m => Unital (->) Void () (Kleisli m a) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> Kleisli m a Void Source #

Alternative f => Unital (->) Void () (Ap f) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> Ap f Void Source #

Alternative f => Unital (->) Void () (Alt f) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> Alt f Void Source #

Alternative f => Unital (->) Void () (Rec1 f) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> Rec1 f Void Source #

(Decidable g, Applicative f) => Unital (->) Void () (ComposeFC f g) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> ComposeFC f g Void Source #

Decidable f => Unital (->) Void () (Backwards f) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> Backwards f Void Source #

Decidable m => Unital (->) Void () (IdentityT m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> IdentityT m Void Source #

Decidable m => Unital (->) Void () (ReaderT r m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> ReaderT r m Void Source #

Decidable m => Unital (->) Void () (StateT w m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> StateT w m Void Source #

Decidable m => Unital (->) Void () (StateT w m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> StateT w m Void Source #

Decidable m => Unital (->) Void () (WriterT w m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> WriterT w m Void Source #

Decidable m => Unital (->) Void () (WriterT w m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> WriterT w m Void Source #

Decidable f => Unital (->) Void () (Reverse f) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> Reverse f Void Source #

Monoid m => Unital (->) () () (Const m :: Type -> Type) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> Const m () Source #

Divisible f => Unital (->) () () (Alt f) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> Alt f () Source #

Divisible m => Unital (->) () () (Rec1 m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> Rec1 m () Source #

(Divisible f, Applicative g) => Unital (->) () () (ComposeCF f g) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> ComposeCF f g () Source #

(Divisible g, Applicative f) => Unital (->) () () (ComposeFC f g) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> ComposeFC f g () Source #

Divisible f => Unital (->) () () (Backwards f) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> Backwards f () Source #

Divisible m => Unital (->) () () (ExceptT e m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> ExceptT e m () Source #

Divisible m => Unital (->) () () (IdentityT m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> IdentityT m () Source #

Divisible m => Unital (->) () () (ReaderT r m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> ReaderT r m () Source #

Divisible m => Unital (->) () () (StateT w m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> StateT w m () Source #

Divisible m => Unital (->) () () (StateT w m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> StateT w m () Source #

Divisible m => Unital (->) () () (WriterT w m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> WriterT w m () Source #

Divisible m => Unital (->) () () (WriterT w m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> WriterT w m () Source #

Monoid m => Unital (->) () () (Constant m :: Type -> Type) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> Constant m () Source #

Divisible f => Unital (->) () () (Reverse f) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> Reverse f () Source #

(Monoid x1, Monoid x2) => Unital (->) () () ((,,) x1 x2) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> (x1, x2, ()) Source #

(Alternative f, Alternative g) => Unital (->) Void () (Product f g) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> Product f g Void Source #

(Alternative f, Alternative g) => Unital (->) Void () (f :*: g) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> (f :*: g) Void Source #

(Applicative f, Applicative g) => Unital (->) () () (Product f g) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> Product f g () Source #

(Divisible f, Divisible g) => Unital (->) () () (f :*: g) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> (f :*: g) () Source #

(Monoid x1, Monoid x2, Monoid x3) => Unital (->) () () ((,,,) x1 x2 x3) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> (x1, x2, x3, ()) Source #

(Alternative f, Applicative g) => Unital (->) Void () (Compose f g) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> Compose f g Void Source #

(Alternative f, Applicative g) => Unital (->) Void () (f :.: g) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> (f :.: g) Void Source #

Alternative f => Unital (->) Void () (M1 i c f) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> M1 i c f Void Source #

Decidable m => Unital (->) Void () (RWST r w s m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> RWST r w s m Void Source #

Decidable m => Unital (->) Void () (RWST r w s m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> RWST r w s m Void Source #

(Applicative f, Applicative g) => Unital (->) () () (Compose f g) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> Compose f g () Source #

(Applicative f, Divisible g) => Unital (->) () () (f :.: g) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> (f :.: g) () Source #

Divisible f => Unital (->) () () (M1 i c f) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> M1 i c f () Source #

Divisible m => Unital (->) () () (RWST r w s m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> RWST r w s m () Source #

Divisible m => Unital (->) () () (RWST r w s m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Methods

introduce :: () -> RWST r w s m () Source #

Monoidal

class (Tensor cat t1 i1, Tensor cat t0 i0, Semigroupal cat t1 t0 f, Unital cat i1 i0 f) => Monoidal cat t1 i1 t0 i0 f Source #

Given monoidal categories \((\mathcal{C}, \otimes, I_{\mathcal{C}})\) and \((\mathcal{D}, \bullet, I_{\mathcal{D}})\). A functor \(F : \mathcal{C} \to \mathcal{D}\) is Monoidal if it maps between \(\mathcal{C}\) and \(\mathcal{D}\) while preserving their monoidal structure. Eg., a homomorphism of monoidal categories.

See NCatlab for more details.

Laws

Right Unitality:

\[ \require{AMScd} \begin{CD} F A \bullet I_{\mathcal{D}} @>{1 \bullet \phi}>> F A \bullet F I_{\mathcal{C}};\\ @VV{\rho_{\mathcal{D}}}V @VV{\phi A,I_{\mathcal{C}}}V \\ F A @<<{F \rho_{\mathcal{C}}}< F (A \otimes I_{\mathcal{C}}); \end{CD} \]

  combine . grmap introducebwd unitr . fwd unitr

Left Unitality:

\[ \begin{CD} I_{\mathcal{D}} \bullet F B @>{\phi \bullet 1}>> F I_{\mathcal{C}} \bullet F B;\\ @VV{\lambda_{\mathcal{D}}}V @VV{\phi I_{\mathcal{C}},B}V \\ F A @<<{F \lambda_{\mathcal{C}}}< F (A \otimes I_{\mathcal{C}} \otimes B); \end{CD} \]

  combine . glmap introducefmap (bwd unitl) . fwd unitl

Instances

Instances details
Monoidal (->) Either Void (,) () ZipList Source # 
Instance details

Defined in Data.Functor.Monoidal

Monoidal (->) Either Void (,) () Comparison Source # 
Instance details

Defined in Data.Functor.Monoidal

Monoidal (->) Either Void (,) () Equivalence Source # 
Instance details

Defined in Data.Functor.Monoidal

Monoidal (->) Either Void (,) () Predicate Source # 
Instance details

Defined in Data.Functor.Monoidal

Monoidal (->) Either Void (,) () STM Source # 
Instance details

Defined in Data.Functor.Monoidal

Monoidal (->) Either Void (,) () ReadP Source # 
Instance details

Defined in Data.Functor.Monoidal

Monoidal (->) Either Void (,) () ReadPrec Source # 
Instance details

Defined in Data.Functor.Monoidal

Monoidal (->) Either Void (,) () IO Source # 
Instance details

Defined in Data.Functor.Monoidal

Monoidal (->) Either Void (,) () Maybe Source # 
Instance details

Defined in Data.Functor.Monoidal

Monoidal (->) Either Void (,) () [] Source # 
Instance details

Defined in Data.Functor.Monoidal

Monoidal (->) (,) () (,) () ZipList Source # 
Instance details

Defined in Data.Functor.Monoidal

Monoidal (->) (,) () (,) () Comparison Source # 
Instance details

Defined in Data.Functor.Monoidal

Monoidal (->) (,) () (,) () Equivalence Source # 
Instance details

Defined in Data.Functor.Monoidal

Monoidal (->) (,) () (,) () Predicate Source # 
Instance details

Defined in Data.Functor.Monoidal

Monoidal (->) (,) () (,) () Identity Source # 
Instance details

Defined in Data.Functor.Monoidal

Monoidal (->) (,) () (,) () IO Source # 
Instance details

Defined in Data.Functor.Monoidal

Monoidal (->) (,) () (,) () NonEmpty Source # 
Instance details

Defined in Data.Functor.Monoidal

Monoidal (->) (,) () (,) () Maybe Source # 
Instance details

Defined in Data.Functor.Monoidal

Monoidal (->) (,) () (,) () [] Source # 
Instance details

Defined in Data.Functor.Monoidal

MonadPlus m => Monoidal (->) Either Void (,) () (WrappedMonad m) Source # 
Instance details

Defined in Data.Functor.Monoidal

ArrowPlus a => Monoidal (->) Either Void (,) () (ArrowMonad a) Source # 
Instance details

Defined in Data.Functor.Monoidal

Monoid r => Monoidal (->) Either Void (,) () (Op r) Source # 
Instance details

Defined in Data.Functor.Monoidal

Monoidal (->) Either Void (,) () (Proxy :: Type -> Type) Source # 
Instance details

Defined in Data.Functor.Monoidal

Monoidal (->) Either Void (,) () (U1 :: Type -> Type) Source # 
Instance details

Defined in Data.Functor.Monoidal

Decidable m => Monoidal (->) Either Void (,) () (MaybeT m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Monoidal (->) (,) () (,) () (Either e) Source # 
Instance details

Defined in Data.Functor.Monoidal

Monoid r => Monoidal (->) (,) () (,) () (Op r) Source # 
Instance details

Defined in Data.Functor.Monoidal

Monoidal (->) (,) () (,) () (U1 :: Type -> Type) Source # 
Instance details

Defined in Data.Functor.Monoidal

Divisible m => Monoidal (->) (,) () (,) () (MaybeT m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Monoid x1 => Monoidal (->) (,) () (,) () ((,) x1) Source # 
Instance details

Defined in Data.Functor.Monoidal

(ArrowZero a, ArrowPlus a) => Monoidal (->) Either Void (,) () (WrappedArrow a b) Source # 
Instance details

Defined in Data.Functor.Monoidal

Alternative m => Monoidal (->) Either Void (,) () (Kleisli m a) Source # 
Instance details

Defined in Data.Functor.Monoidal

Alternative f => Monoidal (->) Either Void (,) () (Ap f) Source # 
Instance details

Defined in Data.Functor.Monoidal

Alternative f => Monoidal (->) Either Void (,) () (Alt f) Source # 
Instance details

Defined in Data.Functor.Monoidal

Alternative f => Monoidal (->) Either Void (,) () (Rec1 f) Source # 
Instance details

Defined in Data.Functor.Monoidal

(Decidable g, Applicative f) => Monoidal (->) Either Void (,) () (ComposeFC f g) Source # 
Instance details

Defined in Data.Functor.Monoidal

Decidable f => Monoidal (->) Either Void (,) () (Backwards f) Source # 
Instance details

Defined in Data.Functor.Monoidal

Decidable m => Monoidal (->) Either Void (,) () (IdentityT m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Decidable m => Monoidal (->) Either Void (,) () (ReaderT r m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Decidable m => Monoidal (->) Either Void (,) () (StateT w m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Decidable m => Monoidal (->) Either Void (,) () (StateT w m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Decidable m => Monoidal (->) Either Void (,) () (WriterT w m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Decidable m => Monoidal (->) Either Void (,) () (WriterT w m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Decidable f => Monoidal (->) Either Void (,) () (Reverse f) Source # 
Instance details

Defined in Data.Functor.Monoidal

Monoid m => Monoidal (->) (,) () (,) () (Const m :: Type -> Type) Source # 
Instance details

Defined in Data.Functor.Monoidal

Divisible f => Monoidal (->) (,) () (,) () (Alt f) Source # 
Instance details

Defined in Data.Functor.Monoidal

Divisible m => Monoidal (->) (,) () (,) () (Rec1 m) Source # 
Instance details

Defined in Data.Functor.Monoidal

(Divisible f, Applicative g) => Monoidal (->) (,) () (,) () (ComposeCF f g) Source # 
Instance details

Defined in Data.Functor.Monoidal

(Divisible g, Applicative f) => Monoidal (->) (,) () (,) () (ComposeFC f g) Source # 
Instance details

Defined in Data.Functor.Monoidal

Divisible f => Monoidal (->) (,) () (,) () (Backwards f) Source # 
Instance details

Defined in Data.Functor.Monoidal

Divisible m => Monoidal (->) (,) () (,) () (ExceptT e m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Divisible m => Monoidal (->) (,) () (,) () (IdentityT m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Divisible m => Monoidal (->) (,) () (,) () (ReaderT r m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Divisible m => Monoidal (->) (,) () (,) () (StateT w m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Divisible m => Monoidal (->) (,) () (,) () (StateT w m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Divisible m => Monoidal (->) (,) () (,) () (WriterT w m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Divisible m => Monoidal (->) (,) () (,) () (WriterT w m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Monoid m => Monoidal (->) (,) () (,) () (Constant m :: Type -> Type) Source # 
Instance details

Defined in Data.Functor.Monoidal

Divisible f => Monoidal (->) (,) () (,) () (Reverse f) Source # 
Instance details

Defined in Data.Functor.Monoidal

(Monoid x1, Monoid x2) => Monoidal (->) (,) () (,) () ((,,) x1 x2) Source # 
Instance details

Defined in Data.Functor.Monoidal

(Alternative f, Alternative g) => Monoidal (->) Either Void (,) () (Product f g) Source # 
Instance details

Defined in Data.Functor.Monoidal

(Alternative f, Alternative g) => Monoidal (->) Either Void (,) () (f :*: g) Source # 
Instance details

Defined in Data.Functor.Monoidal

(Applicative f, Applicative g) => Monoidal (->) (,) () (,) () (Product f g) Source # 
Instance details

Defined in Data.Functor.Monoidal

(Divisible f, Divisible g) => Monoidal (->) (,) () (,) () (f :*: g) Source # 
Instance details

Defined in Data.Functor.Monoidal

(Monoid x1, Monoid x2, Monoid x3) => Monoidal (->) (,) () (,) () ((,,,) x1 x2 x3) Source # 
Instance details

Defined in Data.Functor.Monoidal

(Alternative f, Applicative g) => Monoidal (->) Either Void (,) () (Compose f g) Source # 
Instance details

Defined in Data.Functor.Monoidal

(Alternative f, Applicative g) => Monoidal (->) Either Void (,) () (f :.: g) Source # 
Instance details

Defined in Data.Functor.Monoidal

Alternative f => Monoidal (->) Either Void (,) () (M1 i c f) Source # 
Instance details

Defined in Data.Functor.Monoidal

Decidable m => Monoidal (->) Either Void (,) () (RWST r w s m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Decidable m => Monoidal (->) Either Void (,) () (RWST r w s m) Source # 
Instance details

Defined in Data.Functor.Monoidal

(Applicative f, Applicative g) => Monoidal (->) (,) () (,) () (Compose f g) Source # 
Instance details

Defined in Data.Functor.Monoidal

(Applicative f, Divisible g) => Monoidal (->) (,) () (,) () (f :.: g) Source # 
Instance details

Defined in Data.Functor.Monoidal

Divisible f => Monoidal (->) (,) () (,) () (M1 i c f) Source # 
Instance details

Defined in Data.Functor.Monoidal

Divisible m => Monoidal (->) (,) () (,) () (RWST r w s m) Source # 
Instance details

Defined in Data.Functor.Monoidal

Divisible m => Monoidal (->) (,) () (,) () (RWST r w s m) Source # 
Instance details

Defined in Data.Functor.Monoidal