instance
LawfulAppend.instLawfulMonadWriterT
{M : Type u → Type v}
{ω : Type u}
[Monad M]
[EmptyCollection ω]
[Append ω]
[LawfulAppend ω]
[LawfulMonad M]
:
LawfulMonad (WriterT ω M)
@[simp]
theorem
WriterT.run_mk
{m : Type u → Type v}
[Monad m]
{α ω : Type u}
[LawfulMonad m]
(x : m (α × ω))
:
theorem
WriterT.liftM_def'
{m : Type u → Type v}
[Monad m]
{ω α : Type u}
[EmptyCollection ω]
(x : m α)
:
theorem
WriterT.monadLift_def'
{m : Type u → Type v}
[Monad m]
{ω α : Type u}
[EmptyCollection ω]
(x : m α)
:
@[inline]
Equations
Instances For
instance
WriterT.instAlternativeMonadOfMonoid_toMathlib
{m : Type u → Type v}
[AlternativeMonad m]
{ω : Type u}
[Monoid ω]
:
AlternativeMonad (WriterT ω m)
Equations
- One or more equations did not get rendered due to their size.
instance
WriterT.instLawfulMonadLiftOfLawfulMonad_toMathlib
{m : Type u → Type v}
[AlternativeMonad m]
{ω : Type u}
[Monoid ω]
[LawfulMonad m]
:
LawfulMonadLift m (WriterT ω m)
AddWriterT: Additive Writer Monad Transformer #
@[reducible, inline]
Writer monad transformer with additive cost accumulation.
Defined as WriterT (Multiplicative ω) M, which uses Monoid (Multiplicative ω)
(derived from AddMonoid ω) so that tell accumulates via + with identity 0.
The types Multiplicative ω and ω are definitionally equal (Multiplicative is a plain
def, not a structure), so no runtime wrapping occurs.
Equations
- AddWriterT ω M = WriterT (Multiplicative ω) M