News for hackers. Stuff that matters.
Re:What I Wish I Knew When Learning Haskell by zests on Saturday April 11, 2020 @09:41AM (#22841610)
Both of your questions have the same answer. (x:xs) means x is the first element and xs is the rest.
Re:What I Wish I Knew When Learning Haskell by magicalhippo on Saturday April 11, 2020 @11:01AM (#22841998)
Aha! Thanks.

Obviously picking first element as pivot makes for a very poor Quicksort. Though I presume a better approach, say median of first, mid and last elements, would add but an extra line?

Re:What I Wish I Knew When Learning Haskell by sullyj3 on Sunday April 12, 2020 @10:31AM (#22848475)
The reason the first element is used as the pivot is that these are linked lists, not arrays, so it would take linear time to access the middle and end. This isn't a real quicksort.