[Haskell-beginners] Why does sequence (map print [1, 2, 3, 4, 5]) produce [(), (), (), (), ()] at the end?

Erlend Hamberg erlend at hamberg.no
Wed Feb 3 11:30:02 UTC 2016


On 3 February 2016 at 11:35, Olumide <50295 at web.de> wrote:

> Erm ... sequence (map print) [1,2,3] returns an error.


That's because it will be parsed as `(sequence (map print) [1,2,3]`.
If you use `sequence (map print [1,2,3])`, it should work.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20160203/754794de/attachment.html>


More information about the Beginners mailing list