raw-feldspar-0.2: Resource-Aware Feldspar

Safe HaskellNone
LanguageHaskell2010

Feldspar.Data.Queue

Description

Indexable FIFO queues

Synopsis

Documentation

data Queue a Source #

Indexable FIFO queue

Constructors

Queue 

Fields

initQueueFromBuffer :: forall m a. (Syntax a, MonadComp m) => Arr a -> m (Queue a) Source #

Create a new cyclic queue using an existing array as buffer. The length of the array determines the queue size.

initQueue Source #

Arguments

:: (Manifestable m vec a, Finite vec, Syntax a, MonadComp m) 
=> vec

Initial content (also determines the queue size)

-> m (Queue a) 

Create a new cyclic queue initialized by the given vector (which also determines the size)

newQueue :: (Syntax a, MonadComp m) => Data Length -> m (Queue a) Source #

Create a new cyclic queue of the given length without initialization

initQueueFromBuffer2 Source #

Arguments

:: (Syntax a, MonadComp m) 
=> Data Length

Queue size, must be <= half the buffer size

-> Arr a

Buffer

-> m (Queue a) 

initQueue2 Source #

Arguments

:: (Pushy m vec a, Finite vec, Syntax a, MonadComp m) 
=> vec

Initial content (also determines the queue size)

-> m (Queue a) 

Create a new cyclic queue. This implementation uses a buffer twice as long as the queue size to avoid modulus operations when accessing the elements.

newQueue2 Source #

Arguments

:: (Syntax a, MonadComp m) 
=> Data Length

Queue size

-> m (Queue a) 

Create a new cyclic queue. This implementation uses a buffer twice as long as the queue size to avoid modulus operations when accessing the elements.