| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Proarrow.Promonad.Writer
Synopsis
- data Writer (w :: k) (a :: k) (b :: k) where
- traverseWriter :: forall {k} (p :: k +-> k) (w :: k). (Strong (Tensor :: k -> (k, k) -> Type) p, Ob w) => (Writer w :.: p) :~> (p :.: Writer w)
- writerComp :: forall {k} (r :: k) (s :: k). (SymMonoidal k, Ob r, Ob s) => (Writer r :.: Writer s) ~> Writer (r ** s)
- writerDay :: forall {k} (r :: k) (s :: k). (SymMonoidal k, Ob r, Ob s) => Day (Writer r) (Writer s) ~> Writer (r ** s)
- newtype WriterT (w :: k) (p :: k +-> k) (a :: k) (b :: k) where
- runWriterT :: forall {k} p (w :: k) (a :: k) (b :: k). Profunctor p => WriterT w p a b -> p a (w ** b)
- tell :: forall k (p :: k +-> k) (w :: k). (Promonad p, Monoidal k, Ob w) => WriterT w p w (Unit :: k)
- listen :: forall {k} (p :: k +-> k) (w :: k) (a :: k) (b :: k). (Promonad p, Monoidal k, Comonoid w) => WriterT w p a b -> WriterT w p a (w ** b)
- censor :: forall {k} (p :: k +-> k) (w :: k) (a :: k) (b :: k). (Monoidal k, Ob w) => (w ~> w) -> WriterT w p a b -> WriterT w p a b
Documentation
data Writer (w :: k) (a :: k) (b :: k) where Source Github #
Constructors
| Writer :: forall {k} (b :: k) (a :: k) (w :: k). Ob b => (a ~> (w ** b)) -> Writer w a b |
Instances
| (Ob w, SymMonoidal k) => Strong (Tensor :: k -> (k, k) -> Type) (Writer w :: k -> k -> Type) Source Github # | |||||
| (Monoid w, SymMonoidal k) => MonoidalProfunctor (Writer w :: k -> k -> Type) Source Github # | Note: This is only premonoidal, not monoidal, unless the monoid is commutative. | ||||
| (Ob w, Monoidal k) => Profunctor (Writer w :: k -> k -> Type) Source Github # | |||||
Defined in Proarrow.Promonad.Writer Methods dimap :: forall (c :: k) (a :: k) (b :: k) (d :: k). (c ~> a) -> (b ~> d) -> Writer w a b -> Writer w c d Source Github # lmap :: forall (c :: k) (a :: k) (b :: k). (c ~> a) -> Writer w a b -> Writer w c b Source Github # rmap :: forall (b :: k) (d :: k) (a :: k). (b ~> d) -> Writer w a b -> Writer w a d Source Github # (\\) :: forall (a :: k) (b :: k) r. ((Ob a, Ob b) => r) -> Writer w a b -> r Source Github # | |||||
| (Ob w, CompactClosed k) => Corepresentable (Writer w :: k -> k -> Type) Source Github # | The cowriter comonad given the Promonad instance. | ||||
Defined in Proarrow.Promonad.Writer Methods coindex :: forall (a :: k) (b :: k). Writer w a b -> (Writer w %% a) ~> b Source Github # cotabulate :: forall (a :: k) (b :: k). Ob a => ((Writer w %% a) ~> b) -> Writer w a b Source Github # corepMap :: forall (a :: k) (b :: k). (a ~> b) -> (Writer w %% a) ~> (Writer w %% b) Source Github # corepUniv :: forall (a :: k). Ob a => Writer w a (Writer w %% a) Source Github # | |||||
| (Ob w, Monoidal k) => Representable (Writer w :: k -> k -> Type) Source Github # | The writer monad given the Promonad instance. | ||||
Defined in Proarrow.Promonad.Writer Methods index :: forall (a :: k) (b :: k). Writer w a b -> a ~> (Writer w % b) Source Github # tabulate :: forall (b :: k) (a :: k). Ob b => (a ~> (Writer w % b)) -> Writer w a b Source Github # repMap :: forall (a :: k) (b :: k). (a ~> b) -> (Writer w % a) ~> (Writer w % b) Source Github # repUniv :: forall (a :: k). Ob a => Writer w (Writer w % a) a Source Github # | |||||
| (Ob r, Monoidal k) => Proadjunction (Writer r :: k -> k -> Type) (Reader ('OP r) :: k -> k -> Type) Source Github # | |||||
| (SymMonoidal k, Ob a) => IsWriter (Writer a :: k -> k -> Type) Source Github # | |||||
Defined in Proarrow.Category.Equipment.Stateful Associated Types
| |||||
| (Monoid w, Monoidal k) => Traversable (Writer w :: k -> k -> Type) Source Github # | |||||
| (Monoid w, Monoidal k) => Promonad (Writer w :: k -> k -> Type) Source Github # | |||||
| (Comonoid w, Monoidal k) => Procomonad (Writer w :: k -> k -> Type) Source Github # | |||||
| Monoidal k => Functor (Writer :: k -> k -> k -> Type) Source Github # | |||||
| type (Writer w :: k -> k -> Type) %% (a :: k) Source Github # | |||||
Defined in Proarrow.Promonad.Writer | |||||
| type (Writer w :: k -> k -> Type) % (a :: k) Source Github # | |||||
Defined in Proarrow.Promonad.Writer | |||||
| type WithReader (Writer a :: k -> k -> Type) Source Github # | |||||
Defined in Proarrow.Category.Equipment.Stateful | |||||
traverseWriter :: forall {k} (p :: k +-> k) (w :: k). (Strong (Tensor :: k -> (k, k) -> Type) p, Ob w) => (Writer w :.: p) :~> (p :.: Writer w) Source Github #
A version of traverse specialized to Writer, with fewer requirements on p.
writerComp :: forall {k} (r :: k) (s :: k). (SymMonoidal k, Ob r, Ob s) => (Writer r :.: Writer s) ~> Writer (r ** s) Source Github #
writerDay :: forall {k} (r :: k) (s :: k). (SymMonoidal k, Ob r, Ob s) => Day (Writer r) (Writer s) ~> Writer (r ** s) Source Github #
newtype WriterT (w :: k) (p :: k +-> k) (a :: k) (b :: k) where Source Github #
Constructors
| WriterT :: forall {k} (p :: k +-> k) (w :: k) (a :: k) (b :: k). (p :.: Writer w) a b -> WriterT w p a b |
Instances
| (Strong (Tensor :: k -> (k, k) -> Type) p, Ob w, SymMonoidal k) => Strong (Tensor :: k -> (k, k) -> Type) (WriterT w p :: k -> k -> Type) Source Github # | |
| (MonoidalProfunctor p, Monoid w, SymMonoidal k) => MonoidalProfunctor (WriterT w p :: k -> k -> Type) Source Github # | |
| (Profunctor p, Monoidal k, Ob w) => Profunctor (WriterT w p :: k -> k -> Type) Source Github # | |
Defined in Proarrow.Promonad.Writer Methods dimap :: forall (c :: k) (a :: k) (b :: k) (d :: k). (c ~> a) -> (b ~> d) -> WriterT w p a b -> WriterT w p c d Source Github # lmap :: forall (c :: k) (a :: k) (b :: k). (c ~> a) -> WriterT w p a b -> WriterT w p c b Source Github # rmap :: forall (b :: k) (d :: k) (a :: k). (b ~> d) -> WriterT w p a b -> WriterT w p a d Source Github # (\\) :: forall (a :: k) (b :: k) r. ((Ob a, Ob b) => r) -> WriterT w p a b -> r Source Github # | |
| (Corepresentable p, Ob w, CompactClosed k) => Corepresentable (WriterT w p :: k -> k -> Type) Source Github # | |
Defined in Proarrow.Promonad.Writer Methods coindex :: forall (a :: k) (b :: k). WriterT w p a b -> (WriterT w p %% a) ~> b Source Github # cotabulate :: forall (a :: k) (b :: k). Ob a => ((WriterT w p %% a) ~> b) -> WriterT w p a b Source Github # corepMap :: forall (a :: k) (b :: k). (a ~> b) -> (WriterT w p %% a) ~> (WriterT w p %% b) Source Github # corepUniv :: forall (a :: k). Ob a => WriterT w p a (WriterT w p %% a) Source Github # | |
| (Representable p, Ob w, Monoidal k) => Representable (WriterT w p :: k -> k -> Type) Source Github # | |
Defined in Proarrow.Promonad.Writer Methods index :: forall (a :: k) (b :: k). WriterT w p a b -> a ~> (WriterT w p % b) Source Github # tabulate :: forall (b :: k) (a :: k). Ob b => (a ~> (WriterT w p % b)) -> WriterT w p a b Source Github # repMap :: forall (a :: k) (b :: k). (a ~> b) -> (WriterT w p % a) ~> (WriterT w p % b) Source Github # repUniv :: forall (a :: k). Ob a => WriterT w p (WriterT w p % a) a Source Github # | |
| (Proadjunction p q, Ob r, Monoidal k) => Proadjunction (WriterT r p :: k -> k -> Type) (ReaderT ('OP r) q :: k -> k -> Type) Source Github # | |
| Monoidal k => Functor (WriterT :: k -> (k +-> k) -> k -> k -> Type) Source Github # | |
| (Traversable p, Monoid w) => Traversable (WriterT w p :: k -> k -> Type) Source Github # | |
| (Monoid w, Strong (Tensor :: k -> (k, k) -> Type) p, Promonad p) => Promonad (WriterT w p :: k -> k -> Type) Source Github # | |
| (Monoidal k, Ob w) => Functor (WriterT w :: (k +-> k) -> k -> k -> Type) Source Github # | |
| (Monoid w, Monoidal k) => Promonad (Star (WriterT w) :: (k +-> k) -> (k +-> k) -> Type) Source Github # | WriterT is a monad on profunctors, i.e. we have |
| type (WriterT w p :: k -> k -> Type) %% (a :: k) Source Github # | |
| type (WriterT w p :: k -> k -> Type) % (a :: k) Source Github # | |
runWriterT :: forall {k} p (w :: k) (a :: k) (b :: k). Profunctor p => WriterT w p a b -> p a (w ** b) Source Github #
tell :: forall k (p :: k +-> k) (w :: k). (Promonad p, Monoidal k, Ob w) => WriterT w p w (Unit :: k) Source Github #