<div dir="ltr"><div><div><div><div>map :: (a -> b) -> [a] -> [b]<br>print :: Show a => a -> IO ()<br><br></div>map print :: Show a => [a] -> [IO ()]<br><br></div>print takes a showable a and creates a procedure that prints it out (IO ()).<br></div>So therefore map print causes each element in the array to become a procedure that prints out its element, thus the return value is [IO()].<br><br></div>Note that it has not actually printed them out.  It merely has an array of as yet unexecuted actions.  To print them you'd go like sequence (map print) [1,2,3], or better yet, sequence_ which returns () instead of [()]<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 1, 2016 at 12:28 PM, Olumide <span dir="ltr"><<a href="mailto:50295@web.de" target="_blank">50295@web.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello list,<br>
<br>
The question says it all.<br>
<br>
BTW, I'm studying LYH and I'm on the chapter on IO. The book offers and explanation but its not very clear -- to me at least.<br>
<br>
Thanks,<br>
<br>
- Olumide<br>
<br>
_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org" target="_blank">Beginners@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners</a><br>
</blockquote></div><br></div>