Implementing common sorting algorithms in Haskell.