| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Proarrow.Category.Monoidal.Applicative
Contents
Description
Lax monoidal functors between monoidal categories: Applicative generalizes the Prelude class
with pure and liftA2 stated via the tensor, and Alternative is lax monoidal from the
coproduct of its source to the tensor of its target.
Documentation
class (Monoidal j, Monoidal k, Functor f) => Applicative (f :: j -> k) where Source Github #
Methods
pure :: forall (a :: j). ((Unit :: j) ~> a) -> (Unit :: k) ~> f a Source Github #
liftA2 :: forall (a :: j) (b :: j) (c :: j). (Ob a, Ob b) => ((a ** b) ~> c) -> (f a ** f b) ~> f c Source Github #
Instances
ap :: forall {j} {k} (f :: j -> k) (a :: j) (b :: j). (Applicative f, Closed j, Closed k, Ob a, Ob b) => f (a ~~> b) ~> (f a ~~> f b) Source Github #
fmapDefault :: forall {j} {k} (f :: j -> k) (a :: j) (b :: j). Applicative f => (a ~> b) -> f a ~> f b Source Github #
liftA3 :: forall {j} {k} (f :: j -> k) (a :: j) (b :: j) (c :: j) (d :: j). (Applicative f, Ob a, Ob b, Ob c) => (((a ** b) ** c) ~> d) -> ((f a ** f b) ** f c) ~> f d Source Github #
class (HasBinaryCoproducts j, Monoidal k, Functor f) => Alternative (f :: j -> k) where Source Github #
Methods
empty :: forall (a :: j). Ob a => (Unit :: k) ~> f a Source Github #
alt :: forall (a :: j) (b :: j) (c :: j). (Ob a, Ob b) => ((a || b) ~> c) -> (f a ** f b) ~> f c Source Github #
Instances
| Alternative IO Source Github # | |
| Alternative Maybe Source Github # | |
| Alternative [] Source Github # | |
| Alternative f => Alternative (Prelude f :: Type -> Type) Source Github # | |
| HasBinaryCoproducts k => Alternative (Undecorated :: k -> Type) Source Github # | |
Defined in Proarrow.Category.Instance.Cospan | |
| (DistributiveProfunctor p, Distributive j, Comonoid ('COPR x)) => Alternative (FromProfunctor p x :: j -> Type) Source Github # | |
Defined in Proarrow.Category.Monoidal.Applicative | |
| Alternative (Boxes l :: SORTED s -> Type) Source Github # | No boxes, and the boxes of both sides, the nodes of the second numbered after those of the first. |
Orphan instances
| MonoidalProfunctor p => Applicative (FromProfunctor p x) Source Github # | |
Methods pure :: a -> FromProfunctor p x a Github # (<*>) :: FromProfunctor p x (a -> b) -> FromProfunctor p x a -> FromProfunctor p x b Github # liftA2 :: (a -> b -> c) -> FromProfunctor p x a -> FromProfunctor p x b -> FromProfunctor p x c Github # (*>) :: FromProfunctor p x a -> FromProfunctor p x b -> FromProfunctor p x b Github # (<*) :: FromProfunctor p x a -> FromProfunctor p x b -> FromProfunctor p x a Github # | |