Not that I know any Haskell, but wouldn't smallerSorted already include x due to <= operator?
edit: also, how is the pivot element selected there?
edit: also, how is the pivot element selected there?
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?