Difference between revisions of "Talk:Haskell a la carte"

From HaskellWiki
Jump to navigation Jump to search
 
(No difference)

Latest revision as of 08:26, 12 June 2008

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)