In response to a bit of an obscure use case I had, I created this very simple library which gives you a Monad with a single operation, `push :: a -> m ()`. This operation pushes an item onto a stack (represented under the hood by a mutable ST vector).

When you run the monad, you get the stack out as a vector. 

The library is quite fast. It's about 2x faster than C++'s std::vec::push_back compiled without optimizations, and about 40% as fast as std::vec::push_back when compiled with G++ -O2. There's almost certainly some low-hanging optimization fruit for anyone skilled at Haskell optimizing.

The library is parametric over choice of mutable vector. You can use Unboxed, Storable, or normal vectors.

I've even included a Push Monad Transformer based on Control.Monad.ST.Trans, but that's almost certainly unsafe, per the caveats listed in the Control.Monad.ST.Trans docs.

https://hackage.haskell.org/package/FastPush-0.1.0.0

https://github.com/wyager/FastPush/

Cheers,
Will