State-indexed values #
@[reducible, inline]
A value indexed by a curried tuple of states.
Example:
example : SVal [Nat, Bool] String = (Nat → Bool → String) := rfl
Equations
- Std.Do.SVal [] α = α
- Std.Do.SVal (σ :: σs_2) α = (σ → Std.Do.SVal σs_2 α)
Instances For
A tuple capturing the whole state of an SVal.
Equations
- Std.Do.SVal.StateTuple [] = PUnit
- Std.Do.SVal.StateTuple (σ :: σs_2) = (σ × Std.Do.SVal.StateTuple σs_2)
Instances For
@[instance_reducible]
@[instance_reducible]
instance Std.Do.SVal.instInhabitedStateTupleCons {σ : Type u_1} {σs : List (Type u_1)} [Inhabited σ] [Inhabited (StateTuple σs)] :
Inhabited (StateTuple (σ :: σs))
Curries a function taking a StateTuple into an SVal.
Equations
- Std.Do.SVal.curry f_2 = f_2 PUnit.unit
- Std.Do.SVal.curry f_2 = fun (s : head) => Std.Do.SVal.curry fun (s' : Std.Do.SVal.StateTuple tail) => f_2 (s, s')
Instances For
@[simp]
@[simp]
theorem Std.Do.SVal.curry_cons {α σ : Type u} {σs : List (Type u)} {f : StateTuple (σ :: σs) → α} {s : σ} :
@[simp]
@[simp]
@[instance_reducible]
Equations
- Std.Do.SVal.instInhabited = { default := Std.Do.SVal.curry fun (x : Std.Do.SVal.StateTuple σs) => default }
Auxiliary type class used by SVal.getThe to construct a projection from a list of state types to
one of the component states.
- get : SVal σs σ
A projection from the types
σsof typeσ.
Instances
@[instance_reducible]
Equations
- Std.Do.SVal.instGetTyCons = { get := fun (s : σ) => Std.Do.SVal.curry fun (x : Std.Do.SVal.StateTuple σs) => s }
@[instance_reducible]
instance Std.Do.SVal.instGetTyCons_1 {σ₁ : Type u_1} {σs : List (Type u_1)} {σ₂ : Type u_1} [GetTy σ₁ σs] :
Equations
- Std.Do.SVal.instGetTyCons_1 = { get := fun (x : σ₂) => Std.Do.SVal.GetTy.get }
@[simp]