Documentation

Loom.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.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.

        @[implicit_reducible]

        The trivial complete lattice on EPost.nil.

        @[implicit_reducible]

        Componentwise partial order on EPost.cons, via PProd.

        @[implicit_reducible]

        Componentwise complete lattice on EPost.cons, via PProd.

        Ordering Lemmas #

        Extract a head ordering from an EPost.cons ordering.

        Extract a tail ordering from an EPost.cons ordering.

        theorem Std.Do'.EPost.cons_rel {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.

        The unique EPost.nil value is below any EPost.nil value.

        Notation #

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

        Instances For

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

          Instances For

            Pretty-print EPost.nil as EPost⟨⟩.

            Instances For

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

              Instances For

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

                Instances For