title: Is there an equivalent to Haskell's iterate in Rust?
body: <p>Haskell's <a href="http://hackage.haskell.org/package/base-4.12.0.0/docs/Prelude.html#v:iterate" rel="nofollow noreferrer"><code>iterate</code></a> function repeatedly applies a function to a value to generate a series of values. For example, applying (^2) to 2 generates 2, 2^2, 2^2^2, 2^2^2^2, ... (2, 4, 16, 256, ...)</p>
  
  <p>Is there an equivalent in Rust? </p>