title: Collecting IO outputs into list
body: <p>How can I issue multiple calls to <a href="http://hackage.haskell.org/packages/archive/SDL/0.6.2/doc/html/Graphics-UI-SDL-Events.html#v%3ApollEvent" rel="nofollow noreferrer"><code>SDL.pollEvent :: IO Event</code></a> until the output is <code>SDL.NoEvent</code> and collect all the results into a list?</p>
  
  <p>In imperative terms something like this:</p>
  
  <pre><code>events = []
  event = SDL.pollEvent
  while ( event != SDL.NoEvent ) {
          events.add( event )
          event = SDL.pollEvent
  }
  </code></pre>