Map a function over an EStateM.Result
, preserving states and errors.
Equations
- EStateM.Result.map f (EStateM.Result.ok a s') = EStateM.Result.ok (f a) s'
- EStateM.Result.map f (EStateM.Result.error e s') = EStateM.Result.error e s'
Instances For
@[simp]
theorem
EStateM.run_map
{α β ε σ : Type u_1}
{s : σ}
(f : α → β)
(x : EStateM ε σ α)
:
(f <$> x).run s = Result.map f (x.run s)