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 #
EPost.Nilis the empty exception postcondition (no exceptions).EPost.Cons eh etpairs a head postcondition typeehwith a tailet.EPost⟨e₁, e₂, ...⟩is notation for nestedEPost.Cons.epost⟨v₁, v₂, ...⟩is notation for constructing exception postcondition values.
The empty exception postcondition type, used when a monad has no exception layers.
Instances For
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.
The trivial partial order on EPost.Nil: all values are equal.
The trivial complete lattice on EPost.Nil.
Equations
- Std.Internal.Do.instCompleteLatticeNil = { toPartialOrder := Std.Internal.Do.instPartialOrderNil, has_sup := Std.Internal.Do.instCompleteLatticeNil._proof_1 }
Componentwise partial order on EPost.Cons, via PProd.
Equations
- One or more equations did not get rendered due to their size.
Componentwise complete lattice on EPost.Cons, via PProd.
Equations
- Std.Internal.Do.instCompleteLatticeCons = { toPartialOrder := Std.Internal.Do.instPartialOrderCons, has_sup := ⋯ }
Ordering Lemmas #
Extract a head ordering from an EPost.Cons ordering.
Extract a tail ordering from an EPost.Cons ordering.
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 #
EPost⟨e₁, e₂, ...⟩builds an exception postcondition type (nestedEPost.Cons).epost⟨v₁, v₂, ...⟩builds an exception postcondition value (nestedEPost.Cons.mk).
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.