-- Stability : experimental
-- Portability : portable
--
+-- NOTE: This module is DEPRECATED.
+-- The data structure in "Data.Sequence" is a faster queue and also
+-- supports a wider variety of operations.
+--
-- Queues with constant time operations, from
-- /Simple and efficient purely functional queues and deques/,
-- by Chris Okasaki, /JFP/ 5(4):583-592, October 1995.
--
-----------------------------------------------------------------------------
-module Data.Queue(
- Queue,
+module Data.Queue
+{-# DEPRECATED "Use Data.Sequence instead: it's faster and has more operations" #-}
+ (Queue,
-- * Primitive operations
-- | Each of these requires /O(1)/ time in the worst case.
emptyQueue, addToQueue, deQueue,
listToQueue, queueToList
) where
-#ifdef __HADDOCK__
-import Prelude
-#endif
+import Prelude -- necessary to get dependencies right
+import Data.Typeable
-- | The type of FIFO queues.
data Queue a = Q [a] [a] [a]
+#include "Typeable.h"
+INSTANCE_TYPEABLE1(Queue,queueTc,"Queue")
+
-- Invariants for Q xs ys xs':
-- length xs = length ys + length xs'
-- xs' = drop (length ys) xs -- in fact, shared (except after fmap)