Equations
- Std.instMembershipNatRange = { mem := fun i r => r.start ≤ i ∧ i < r.stop }
@[inline]
def
Std.Range.forIn
{β : Type u}
{m : Type u → Type v}
[inst : Monad m]
(range : Std.Range)
(init : β)
(f : Nat → β → m (ForInStep β))
:
m β
Equations
- Std.Range.forIn range init f = Std.Range.forIn.loop f range.stop range.start range.stop range.step init
@[specialize]
def
Std.Range.forIn.loop
{β : Type u}
{m : Type u → Type v}
[inst : Monad m]
(f : Nat → β → m (ForInStep β))
(fuel : Nat)
(i : Nat)
(stop : Nat)
(step : Nat)
(b : β)
:
m β
Equations
- One or more equations did not get rendered due to their size.
- Std.Range.forIn.loop f 0 i stop step b = if i ≥ stop then pure b else pure b
@[inline]
def
Std.Range.forIn'
{β : Type u}
{m : Type u → Type v}
[inst : Monad m]
(range : Std.Range)
(init : β)
(f : (i : Nat) → i ∈ range → β → m (ForInStep β))
:
m β
Equations
- Std.Range.forIn' range init f = Std.Range.forIn'.loop range.start range.stop range.step f range.stop range.start (_ : range.start ≤ range.start) init
@[specialize]
def
Std.Range.forIn'.loop
{β : Type u}
{m : Type u → Type v}
[inst : Monad m]
(start : Nat)
(stop : Nat)
(step : Nat)
(f : (i : Nat) → start ≤ i ∧ i < stop → β → m (ForInStep β))
(fuel : Nat)
(i : Nat)
(hl : start ≤ i)
(b : β)
:
m β
Equations
- One or more equations did not get rendered due to their size.
@[inline]
def
Std.Range.forM
{m : Type u → Type v}
[inst : Monad m]
(range : Std.Range)
(f : Nat → m PUnit)
:
m PUnit
Equations
- Std.Range.forM range f = Std.Range.forM.loop f range.stop range.start range.stop range.step
@[specialize]
def
Std.Range.forM.loop
{m : Type u → Type v}
[inst : Monad m]
(f : Nat → m PUnit)
(fuel : Nat)
(i : Nat)
(stop : Nat)
(step : Nat)
:
m PUnit
Equations
- Std.Range.forM.loop f 0 i stop step = if i ≥ stop then pure PUnit.unit else pure PUnit.unit
- Std.Range.forM.loop f (Nat.succ fuel_2) i stop step = if i ≥ stop then pure PUnit.unit else do f i Std.Range.forM.loop f fuel_2 (i + step) stop step
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.