Mergesort implementation in Haskell