summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghci.debugger/scripts/T2950S.hs
blob: 0685381f9f5a1b74006e8b0c95d9e13a143f7afd (plain)
1
2
3
4
5
6
7
8
module T2950S where
sort :: Ord a => [a] -> [a]
sort [] = []
sort (x:xs) = insert x (sort xs)
  where
    insert x [] = [x]
    insert x (y:ys) | x < y     = x:y:ys
                    | otherwise = y:(insert x ys)