This file contains simp lemmas for proofs about code that uses the do
notation together with Except and Option.
theorem
bind_ne_error
{α β : Type u_1}
{ε : Type u_2}
{r : Except ε α}
{f : α → Except ε β}
{e : ε}
(hr : r ≠ Except.error e)
(hf : ∀ (a : α), r = Except.ok a → f a ≠ Except.error e)
:
Monadic bind preserves "not this error": if neither the first computation nor
the continuation (on success) yields error e, the bind does not either.
@[simp]
theorem
to_option_distr_map
{ε : Type u_1}
{α : Type u_2}
{β : Type u_3}
{x : Except ε α}
{f : α → β}
: