Next | Atypical Types | 71 |
Solution: Add a clause
sort [] = [] sort [x] = [x] sort ls = merge (sort p) (sort q) where (p, q) = split ls
The type is now:
sort :: (Ord a) => [a] -> [a]
as we expected it should be.
Next | Copyright © 1999,2008 Mark Dominus |