<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Because applying f to the list is not the same thing is applying bind to the list and f.</div><div><br></div><div>Bob</div><br><div><div>On 26 Feb 2011, at 20:17, michael rice wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top" style="font: inherit;">Why? Shouldn't this work for any type a?<br><br>Michael<br><br>==========<br><br><span style="font-family: courier,monaco,monospace,sans-serif;">f :: [a] -&gt; [a]</span><br style="font-family: courier,monaco,monospace,sans-serif;"><span style="font-family: courier,monaco,monospace,sans-serif;">f l = do x &lt;- l</span><br style="font-family: courier,monaco,monospace,sans-serif;"><span style="font-family: courier,monaco,monospace,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return x</span><br style="font-family: courier,monaco,monospace,sans-serif;"><br>==========<br><br>*Main&gt; :r<br>[1 of 1] Compiling Main&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ( test.hs, interpreted )<br>Ok, modules loaded: Main.<br>*Main&gt; f "abcde"<br>"abcde"<br>*Main&gt; f [1,2,3,4,5]<br>[1,2,3,4,5]<br>*Main&gt; "abcde" &gt;&gt;=
 f<br><br>&lt;interactive&gt;:1:12:<br>&nbsp;&nbsp;&nbsp; Couldn't match expected type `Char' against inferred type `m b'<br>&nbsp;&nbsp;&nbsp; In the second argument of `(&gt;&gt;=)', namely `f'<br>&nbsp;&nbsp;&nbsp; In the expression: "abcde" &gt;&gt;= f<br>&nbsp;&nbsp;&nbsp; In the definition of `it': it = "abcde" &gt;&gt;= f<br>*Main&gt; <br><br></td></tr></tbody></table><br>







      _______________________________________________<br>Haskell-Cafe mailing list<br><a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>http://www.haskell.org/mailman/listinfo/haskell-cafe<br></blockquote></div><br></body></html>