qsort1 qsort1 Ord qsort1 qsort1 xs qsort1 lesser qsort1 greater where

1
2
3
4
5
6
7
<<qsort1>>=
qsort1 :: Ord a => [a] -> [a]
qsort1 [] = []
qsort1 (p:xs) = qsort1 lesser ++ [p] ++ qsort1 greater
where
lesser = [ y | y <- xs, y < p ]
greater = [ y | y <- xs, y >= p ]