3 ms·
You can define a mutable std::sort like function in Haskell: mutableSort :: (MArray arr elem m, Ord elem, Ix ix) => arr ix elem -> m () This can work on mut
by Peaker 12y ago
You can define a mutable std::sort like function in Haskell:
mutableSort :: (MArray arr elem m, Ord elem, Ix ix) => arr ix elem -> m ()
This can work on mutable arrays in the IO, ST, or other mutable-array supporting monads. It also has a generalized index type (though newer array libraries threw that part away, so it's not considered a good idea anymore).