[Haskell-beginners] Why does sequence (map print [1, 2, 3, 4, 5]) produce [(), (), (), (), ()] at the end?
Olumide
50295 at web.de
Wed Feb 3 10:35:17 UTC 2016
- Previous message: [Haskell-beginners] Why does sequence (map print [1, 2, 3, 4, 5]) produce [(), (), (), (), ()] at the end?
- Next message: [Haskell-beginners] Why does sequence (map print [1, 2, 3, 4, 5]) produce [(), (), (), (), ()] at the end?
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
On 01/02/2016 17:39, David McBride wrote:
> Note that it has not actually printed them out.
I hope you don't mind me asking but why then does sequence (map print
[1,2,3] ) return the numbers 1, 2, 3 (albeit followed by [(),(),()]).
> It merely has an array of as yet unexecuted actions. To print them
> you'd go like sequence (map print) [1,2,3] ...
Erm ... sequence (map print) [1,2,3] returns an error.
- Olumide
- Previous message: [Haskell-beginners] Why does sequence (map print [1, 2, 3, 4, 5]) produce [(), (), (), (), ()] at the end?
- Next message: [Haskell-beginners] Why does sequence (map print [1, 2, 3, 4, 5]) produce [(), (), (), (), ()] at the end?
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Beginners
mailing list