title: Get value from "IO a" is interpreted as list
body: <p>I'm learning haskell with <a href="https://en.wikibooks.org/wiki/Haskell/Solutions/Higher-order_functions_and_Currying" rel="nofollow">wikibooks</a>.</p>
  
  <p>Given is the signature. The solution to the problem is:</p>
  
  <pre><code>sequenceIO :: [IO a] -&gt; IO [a]
  sequenceIO [] = return []
  sequenceIO (a:as) = do {v &lt;-a ; vs &lt;- (sequenceIO as) ; return (v : vs)}
  </code></pre>
  
  <p>My solution was (which does not work):</p>
  
  <pre><code>sequenceIO xs = return (foldl get [] xs)
    where get ys act = do y &lt;- act
                          ys ++ [y]
  </code></pre>
  
  <p>The "get" singled out as a function:</p>
  
  <pre><code>gett :: [a] -&gt; IO a -&gt; [a]
  gett ys act = do y &lt;- act
                   ys ++ y
  </code></pre>
  
  <p>will not work: a list as a second parameter is infered. Why? In the solution the <code>v &lt;-a</code> works too.</p>