Documentation

Init.Internal.Order.MonadTail

class Lean.Order.MonadTail (m : Type u → Type v) [Bind m] :
Type (max (u + 1) v)

A tail monad is a monad whose bind operation preserves a chosen ordering of the continuation. Specifically, MonadTail m asserts that every m β carries a chain-complete partial order (CCPO) and that >>= is monotone in its second (continuation) argument with respect to that order.

This is a weaker requirement than MonoBind, which requires monotonicity in both arguments. MonadTail is sufficient for partial_fixpoint-like recursive definitions where the recursive call only appears in the continuation (second argument) of >>=.

Instances
    theorem Lean.Order.MonadTail.monotone_bind_right (m : Type u → Type v) [Monad m] [MonadTail m] {α β : Type u} [Nonempty β] {γ : Sort w} [PartialOrder γ] (f : m α) (g : γαm β) (hmono : monotone g) :
    monotone fun (x : γ) => f >>= g x
    @[implicit_reducible]
    Equations
    • One or more equations did not get rendered due to their size.
    @[implicit_reducible]
    instance Lean.Order.instMonadTailStateTOfNonempty {σ : Type u} {m : Type u → Type v} [Monad m] [MonadTail m] [Nonempty σ] :
    Equations
    • One or more equations did not get rendered due to their size.
    @[implicit_reducible]
    instance Lean.Order.instMonadTailExceptT {ε : Type u} {m : Type u → Type v} [Monad m] [MonadTail m] :
    Equations
    @[implicit_reducible]
    Equations
    • One or more equations did not get rendered due to their size.
    @[implicit_reducible]
    Equations
    @[implicit_reducible]
    Equations
    @[implicit_reducible]
    instance Lean.Order.instMonadTailReaderT {ρ : Type u} {m : Type u → Type v} [Monad m] [MonadTail m] :
    Equations
    noncomputable def Lean.Order.ST.bot' {α σ : Type} [Nonempty α] (s : Void σ) :
    Equations
    Instances For
      @[implicit_reducible]
      instance Lean.Order.instCCPOSTOfNonempty {α σ : Type} [Nonempty α] :
      CCPO (ST σ α)
      Equations
      @[implicit_reducible]
      Equations
      @[implicit_reducible]
      Equations
      @[implicit_reducible]
      Equations
      @[implicit_reducible]
      Equations
      @[implicit_reducible]
      instance Lean.Order.instMonadTailStateRefT' {ω σ : Type} {m : TypeType} [Monad m] [MonadTail m] :
      Equations