Greetings. I'd just like to point out that Haskell can very well do side-effects inside the IO monad, including in-place sorting, down to
pointer arithmetic with C structures. Ever since the Monadic Revolution, side effects in Haskell has become composable and distinguished from pure values, but every bit as usable as the equivalent C code.