On the [Haskell website](http://www.haskell.org), there's this example [quicksort implementation](http://www.haskell.org/haskellwiki/Introduction#Quicksort_in_Haskell):

```
quicksort :: Ord a => [a] -> [a]
quicksort []     = []
quicksort (p:xs) = (quicksort lesser) ++ [p] ++ (quicksort greater)
    where
        lesser  = filter (< p) xs
        greater = filter (>= p) xs

```

There is an explanation on the site, but I have a couple of questions that I didn't see were addressed ...

* where is the actual comparison/swap done on two elements for a re-order? Is this handled by the 'Ord' (ordered) type definition itself. So the type enforces this condition of being ordered?
* the 'greater' filter defines items '>= p' (the pivot), so doesn't this mean we'll end up with an extra pivot [p] in resulting list of the function, due to the '++ [p]' item?