I looked at various Haskell resources on the web, before buying the book, Real World Haskell. Being otherwise excellent, it doesn’t seem to contain anything about list comprehensions which I saw mentioned in the various websites I looked at. Could this just be because they are generally unused in well written Haskell for some reason, or is it something more complex? For instance the odd looking syntax could conceivably just be some amalgamation of operators I haven’t seen yet.
Share
List comprehensions are mentioned briefly in Chapter 12.
I find myself using combinations of map and filter much more often than list comprehensions in Haskell, but in Python I would more frequently use a list comprehension. So I think part of it is personal style.
Once you understand how to use each part of a list comprehension, what more is there for you to learn in regards to list comprehensions? You have your inputs, your conditions/guards, and your function applications for the returned list. I don’t really see a warranted need for a large section about list comprehensions in a book.