title: Haskell IO with interact and map
body: <p>I am trying to produce an interactive Haskell program using the <code>interact</code> function with <code>map</code>.</p>
  
  <p>Here's what I get in <strong>ghci</strong> (as far as I can tell, that's the way all tutorials explain <code>interact</code> usage -- except the result).</p>
  
  <pre><code>*Module&gt; interact $ unlines . map (++ "!") . lines
  tteesstt
  !
  </code></pre>
  
  <p>Note that what actually happens is that every character I type is instantly repeated and after I press Return the exclamation mark appears. I was, however, expecting this:</p>
  
  <pre><code>*Module&gt; interact $ unlines . map (++ "!") . lines
  test
  test!
  </code></pre>
  
  <p>It works perfectly if I use the same program structure, but <code>filter</code> instead of <code>map</code>.</p>