fix(library/init/control/combinators): iterate forward
This commit is contained in:
parent
9e246b365e
commit
ff47eba9d1
1 changed files with 3 additions and 3 deletions
|
|
@ -32,12 +32,12 @@ mcond c t (pure ())
|
|||
|
||||
namespace Nat
|
||||
|
||||
@[specialize] def mforAux {m} [Applicative m] (f : Nat → m Unit) : Nat → m Unit
|
||||
@[specialize] def mforAux {m} [Applicative m] (f : Nat → m Unit) (n : Nat) : Nat → m Unit
|
||||
| 0 := pure ()
|
||||
| (i+1) := f i *> mforAux i
|
||||
| (i+1) := f (n-i-1) *> mforAux i
|
||||
|
||||
@[inline] def mfor {m} [Applicative m] (n : Nat) (f : Nat → m Unit) : m Unit :=
|
||||
mforAux f n
|
||||
mforAux f n n
|
||||
|
||||
-- TODO: enable after we have support for marking arguments that should be considered for specialization.
|
||||
/-
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue