Documentation

Std.Internal.Do.ExceptPost

Exception Postcondition Types #

Heterogeneous lists of exception postconditions for monads with multiple exception layers.

An EPost is a type-level list that tracks postconditions for each exception type in a monad transformer stack. For example, ExceptT Nat (ExceptT String (StateM σ)) would use EPost⟨Nat → σ → Prop, String → σ → Prop⟩ to specify postconditions for both exception types.

Overview #

The empty exception postcondition type, used when a monad has no exception layers.

    Instances For
      structure Std.Internal.Do.EPost.Cons (eh : Type u) (et : Type v) :
      Type (max u v)

      A cons cell pairing a head exception postcondition type eh with a tail et.

      For a monad with exception type ε over lattice l, the head eh is typically ε → l and the tail et tracks remaining exception layers.

      • head : eh

        The head exception postcondition.

      • tail : et

        The tail exception postconditions.

      Instances For

        Partial Order and Complete Lattice Instances #

        Exception postconditions are ordered componentwise: p ⊑ q iff each component of p is below the corresponding component of q.

        @[implicit_reducible]

        The trivial partial order on EPost.Nil: all values are equal.

        Equations
        @[implicit_reducible]

        Componentwise partial order on EPost.Cons, via PProd.

        Equations
        • One or more equations did not get rendered due to their size.
        @[implicit_reducible]

        Componentwise complete lattice on EPost.Cons, via PProd.

        Equations

        Ordering Lemmas #

        Extract a head ordering from an EPost.Cons ordering.

        Extract a tail ordering from an EPost.Cons ordering.

        theorem Std.Internal.Do.EPost.Cons.mk_le {e : Type u_1} {e' : Type u_2} [Lean.Order.PartialOrder e] [Lean.Order.PartialOrder e'] (eposth : e) (epostt : e') (epost : EPost.Cons✝ e e') :

        An EPost.Cons value is below another if both components are below.

        An EPost.Cons value is below another if both components are below.

        The head component of the bottom EPost.Cons is the bottom element. Propositional (not definitional), because of a complete lattice is csup ∅, not a constructor application.

        Notation #

        Exception postcondition type notation: EPost⟨ε₁ → l, ε₂ → l⟩ for nested EPost.Cons.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For

          Exception postcondition value notation: epost⟨h₁, h₂⟩ for nested EPost.Cons.mk.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For

            Pretty-print EPost.Nil as EPost⟨⟩.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For

              Pretty-print EPost.Cons as EPost⟨e₁, e₂, ...⟩.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For

                Pretty-print EPost.Nil.mk as epost⟨⟩.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For

                  Pretty-print EPost.Cons.mk as epost⟨v₁, v₂, ...⟩.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For