add Data.Sequence to nhc98 build
[haskell-directory.git] / Data / Queue.hs
index 91a7d34..55abe39 100644 (file)
@@ -8,14 +8,19 @@
 -- 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,
@@ -24,10 +29,14 @@ module Data.Queue(
     ) where
 
 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)