title: Couldn't match expected type ‘IO a0’ with actual type ‘a1 -> IO ()’
body: <p>Works:
  </p>
  
  <pre><code>enumerate = \todos -&gt;
      setSGR [SetColor Foreground Vivid Red] &gt;&gt;=
      (\_ -&gt; putStrLn $ unlines $ map transform todos) &gt;&gt;
      setSGR [Reset]
  </code></pre>
  
  <p>Doesn't work:
  </p>
  
  <pre><code>enumerate = \todos -&gt;
      setSGR [SetColor Foreground Vivid Red] &gt;&gt;
      putStrLn . unlines . map transform todos &gt;&gt;
      setSGR [Reset]
  </code></pre>
  
  <p>As far as I can undestand, <code>&gt;&gt;=</code> passes on the variable, which is then ignored in the subsequent lambda <code>(\_ -&gt; ...)</code>. However, when I transform that to using <code>&gt;&gt;</code> and have function composition, it doesn't appear to work.</p>
  
  <p>What is the difference between the two that causes the second not to compile? It'd be great to know why those two expressions aren't equivalent.</p>
  
  <pre><code>/Users/atimberlake/Webroot/HTodo/htodo/app/Main.hs:18:25:
      Couldn't match expected type ‘IO a0’ with actual type ‘a1 -&gt; IO ()’
      In the second argument of ‘(&gt;&gt;)’, namely
        ‘putStrLn . unlines . map transform todos’
      In the first argument of ‘(&gt;&gt;)’, namely
        ‘setSGR [SetColor Foreground Vivid Red]
         &gt;&gt; putStrLn . unlines . map transform todos’
      In the expression:
        setSGR [SetColor Foreground Vivid Red]
        &gt;&gt; putStrLn . unlines . map transform todos
        &gt;&gt; setSGR [Reset]
  
  /Users/atimberlake/Webroot/HTodo/htodo/app/Main.hs:18:46:
      Couldn't match expected type ‘a1 -&gt; [String]’
                  with actual type ‘[[Char]]’
      Possible cause: ‘map’ is applied to too many arguments
      In the second argument of ‘(.)’, namely ‘map transform todos’
      In the second argument of ‘(.)’, namely
        ‘unlines . map transform todos’
  </code></pre>