Catenable (in constant-time) queues and deques in Haskell