-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A strict, immutable, thread-safe, single-ended, bounded queue. -- -- A strict, immutable, thread-safe, single-ended, bounded queue which -- automatically forgets old values instead of blocking. @package bounded-queue @version 1.0.0 -- | This library provides a strict, immutable, thread-safe, single-ended, -- bounded queue. When the insert limit is reached and a cons is -- attempted, this BQueue automatically drops old entries off its -- end. Thus, writes always succeed and never block. -- -- This data structure is intended as a "sliding window" over some stream -- of data, where we wish old entries to be naturally forgotten. Since -- this is an immutable data structure and not a concurrent queue, we -- provide instances for the usual useful typeclasses with which one can -- perform analysis over the entire "window". -- -- This module is intended to be imported qualified: -- --
--   import qualified Data.Queue.Bounded as BQ
--   
module Data.Queue.Bounded -- | A single-ended, bounded queue which keeps track of its size. data BQueue a -- | Given a limit value, yield an empty BQueue. empty :: Int -> BQueue a -- | Given a limit value and an initial value, yield a singleton -- BQueue. singleton :: Int -> a -> BQueue a -- | <math>. Naively keeps the first <math> values of the input -- list (as defined by the given limiting Int value) and does not -- attempt any elegant queue-like cycling. fromList :: Int -> [a] -> BQueue a -- | <math>. cons :: a -> BQueue a -> BQueue a -- | <math>. uncons :: BQueue a -> Maybe (a, BQueue a) -- | <math>. average :: Integral a => BQueue a -> a -- | <math>. reverse :: BQueue a -> BQueue a -- | <math>. take :: Int -> BQueue a -> BQueue a -- | <math>. drop :: Int -> BQueue a -> BQueue a instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Data.Queue.Bounded.BQueue a) instance GHC.Generics.Generic (Data.Queue.Bounded.BQueue a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.Queue.Bounded.BQueue a) instance GHC.Show.Show a => GHC.Show.Show (Data.Queue.Bounded.BQueue a) instance GHC.Base.Functor Data.Queue.Bounded.BQueue instance Data.Foldable.Foldable Data.Queue.Bounded.BQueue instance Data.Traversable.Traversable Data.Queue.Bounded.BQueue instance GHC.Base.Semigroup (Data.Queue.Bounded.BQueue a)