[Haskell-cafe] To [] Or Not To []

Johannes Waldmann johannes.waldmann at htwk-leipzig.de
Thu Mar 9 15:07:16 UTC 2017

Dear Cafe,

I wrote a text (well, you might call it a rant)
on the tragic over-use of lists in Haskell,
based on my experience in programming and teaching.


* If your program accesses a list by index (with the !! operator),
  then your program is wrong.
* If your program uses the length function, then your program is wrong.
* If your program sorts a list, then your program is wrong.
* If you wrote this sort function yourself, then it is doubly wrong.
* The ideal use of a list is such that will be removed by the compiler.
* The enlightened programmer writes list-free code with Foldable.

Have fun reading, and avoiding lists from here on!

- J.W.

More information about the Haskell-Cafe mailing list