@[specialize]
Equations
- Nat.forM.loop n f 0 = pure ()
- Nat.forM.loop n f (Nat.succ i) = do f (n - i - 1) Nat.forM.loop n f i
@[inline]
Equations
- Nat.forRevM n f = Nat.forRevM.loop f n
@[specialize]
Equations
- Nat.forRevM.loop f 0 = pure ()
- Nat.forRevM.loop f (Nat.succ i) = do f i Nat.forRevM.loop f i
@[specialize]
def
Nat.foldM.loop
{α : Type u}
{m : Type u → Type v}
[inst : Monad m]
(f : Nat → α → m α)
(n : Nat)
:
Nat → α → m α
Equations
- Nat.foldM.loop f n 0 _fun_discr = pure _fun_discr
- Nat.foldM.loop f n (Nat.succ i) _fun_discr = f (n - i - 1) _fun_discr >>= Nat.foldM.loop f n i
@[inline]
def
Nat.foldRevM
{α : Type u}
{m : Type u → Type v}
[inst : Monad m]
(f : Nat → α → m α)
(init : α)
(n : Nat)
:
m α
Equations
- Nat.foldRevM f init n = Nat.foldRevM.loop f n init
@[specialize]
def
Nat.foldRevM.loop
{α : Type u}
{m : Type u → Type v}
[inst : Monad m]
(f : Nat → α → m α)
:
Nat → α → m α
Equations
- Nat.foldRevM.loop f 0 _fun_discr = pure _fun_discr
- Nat.foldRevM.loop f (Nat.succ i) _fun_discr = f i _fun_discr >>= Nat.foldRevM.loop f i