title: Produce the infinite list [0, 1, -1, 2, -2, ... in Haskell
body: <p>So suppose we want to produce the list <code>[0, 1, -1, 2, -2, ...</code>in Haskell.</p>
  
  <p>What is the most elegant way of accomplishing this?</p>
  
  <p>I came up with this solution:</p>
  
  <pre><code>solution = [0] ++ foldr (\(a,b) c-&gt;a:b:c) [] zip [1..] $ map negate [1..]
  </code></pre>
  
  <p>But I am sure there must be a better way.</p>