title: Cannot get (->) r monad to work with SDL2 rendering
body: <p>I have a small working SDL2 sample (a straightforward port of a C++ tutorial) and am trying to refactor the rendering code into using the (->) r monad. Here's the working part of the sample without the refactoring</p>
  
  <pre><code>renderClear renderer
  renderCopy renderer texture nullPtr nullPtr
  renderPresent renderer
  </code></pre>
  
  <p>Make &amp; run - the texture is there. Both</p>
  
  <pre><code>renderClear renderer
  flip ($) renderer $ do
      copy texture nullPtr nullPtr
  renderPresent renderer
  </code></pre>
  
  <p>and</p>
  
  <pre><code>renderClear renderer
  renderCopy renderer texture nullPtr nullPtr
  flip ($) renderer $ do
      present
  </code></pre>
  
  <p>work fine too. Yet</p>
  
  <pre><code>renderClear renderer
  flip ($) renderer $ do
      copy texture nullPtr nullPtr
      present
  </code></pre>
  
  <p>just draws the black window and that's it. <code>present</code> is an alias of <code>renderPresent</code> and <code>copy</code> is <code>renderCopy</code> with first argument shifted to the end. Do it have something to do with these functions working with IO? How can I fix this?</p>