I want to make the biggersort function recall itself recursively on the tail of the list. My code below works and gives me the following output :
[6,7,8]
I want to continue by starting next with 3 then 1 .. to the last element.
What I want is something like :
[[6,7,8],[3,5,7,8],[1,5,7,8]..]
My code:
import Data.List
import System.IO
biggersort :: Ord a => [a] -> [a]
biggersort [] = []
biggersort (p:xs) = [p] ++ (biggersort greater)
where
greater = filter (>= p) xs
main = do
print $ biggersort [6,3,1,5,2,7,8,1]