title: Haskell: can't use "map putStrLn"?
body: <p>I have a list of strings, and tried this:</p>
  
  <pre><code>ls = [ "banana", "mango", "orange" ]
  
  main = do
         map PutStrLn list_of_strings
  </code></pre>
  
  <p>That didn't work, and I can't understand why.</p>
  
  <pre><code>ghc print-list.hs
  print-list.hs:3:0:
      Couldn't match expected type `IO t' against inferred type `[IO ()]'
      In the expression: main
      When checking the type of the function `main'
  </code></pre>
  
  <p>Any hints? I suppose it has to do with map returning a list and not a value, but I didn't find an easy way to fix this.</p>
  
  <p>Right now the only way I know to print a list of strings is to write a function that will iterate the list, printing each element (print if the list is [a], but print and recurse if it's (a:b)). But it would be <em>much</em> simpler to just use map...</p>
  
  <p>Thanks!</p>