Quick Stack implementation in Haskell