Talk:Haskell a la carte

From HaskellWiki
Jump to navigation Jump to search

Quicksort

I insist that

  sort :: Ord a => [a] -> [a]
  sort []     = []
  sort (x:xs) = sort (filter (<x) xs) ++ [x] ++ sort (filter (>=x) xs))

is a quicksort implementation. It's not in-place, but it has the same spirit and recursion pattern. -- apfeλmus 08:26, 12 June 2008 (UTC)