queue_classic in Haskell