Quicksort implementation for mutable arrays (MArray) in Haskell