Documentation

Batteries.Lean.EStateM

def EStateM.Result.map {ε σ α β : Type u} (f : αβ) (x : EStateM.Result ε σ α) :

Map a function over an EStateM.Result, preserving states and errors.

Equations
Instances For
    @[simp]
    theorem EStateM.Result.map_ok {ε σ α β : Type u} (f : αβ) (a : α) (s : σ) :
    @[simp]
    theorem EStateM.Result.map_error {ε σ α β : Type u} (f : αβ) (e : ε) (s : σ) :
    @[simp]
    theorem EStateM.Result.map_eq_ok {ε σ α β : Type u} (f : αβ) (x : EStateM.Result ε σ α) (b : β) (s : σ) :
    EStateM.Result.map f x = EStateM.Result.ok b s ∃ (a : α), x = EStateM.Result.ok a s b = f a
    @[simp]
    theorem EStateM.Result.map_eq_error {ε σ α β : Type u} (f : αβ) (x : EStateM.Result ε σ α) (e : ε) (s : σ) :
    @[simp]
    theorem EStateM.run_map {α β ε σ : Type u_1} {s : σ} (f : αβ) (x : EStateM ε σ α) :
    (f <$> x).run s = EStateM.Result.map f (x.run s)
    theorem EStateM.ext {ε σ α : Type u} (x y : EStateM ε σ α) (h : ∀ (s : σ), x.run s = y.run s) :
    x = y