iterate package:clash-prelude

"iterate n f x" returns a vector starting with x followed by n repeated applications of f to x.
iterate (SNat :: SNat 4) f x == (x :> f x :> f (f x) :> f (f (f x)) :> Nil)
iterate d4 f x               == (x :> f x :> f (f x) :> f (f (f x)) :> Nil)
>>> iterate d4 (+1) 1
1 :> 2 :> 3 :> 4 :> Nil
"iterate n f z" corresponds to the following circuit layout:
"iterateI f x" returns a vector starting with x followed by n repeated applications of f to x, where n is determined by the context.
iterateI f x :: Vec 3 a == (x :> f x :> f (f x) :> Nil)
>>> iterateI (+1) 1 :: Vec 3 Int
1 :> 2 :> 3 :> Nil
"iterateI f z" corresponds to the following circuit layout: