Inner loop for Fin.foldl
. Fin.foldl.loop n f x i = f (f (f x i) ...) (n-1)
Equations
- foldl.loop n f x i = if h : i < n then foldl.loop n f (f x { val := i, isLt := h }) (i + 1) else x
Instances For
Inner loop for Fin.foldr
. Fin.foldr.loop n f i x = f 0 (f ... (f (i-1) x))
Equations
- foldr.loop n f { val := 0, property := property } x = x
- foldr.loop n f { val := Nat.succ i, property := h } x = foldr.loop n f { val := i, property := ⋯ } (f { val := i, isLt := h } x)