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.
Componentwise partial order on EPost.cons, via PProd.
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.
An EPost.cons value is below another if both components are below.
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.
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.nil.mk as epost⟨⟩.
Instances For
Pretty-print EPost.cons.mk as epost⟨v₁, v₂, ...⟩.