- class Monad m => NewFifo q m where
- newFifo :: m q

- class Monad m => DefaultFifo q m a | q -> a, m a -> q
- newDefaultFifoFor :: (DefaultFifo q m a, NewFifo q m) => a -> m q
- class Monad m => Enqueue q m a | q -> a where
- class Monad m => Dequeue q m a | q -> a where
- class Monad m => DequeueWhere q m a | q -> a where
- dequeueWhere :: q -> (a -> Bool) -> m (Maybe a)

- class Monad m => PeekQueue q m a | q -> a where
- peekQueue :: q -> m [a]
- peekQueueTaking :: Int -> q -> m [a]

- class Monad m => QueueSize q m where

# Documentation

class Monad m => NewFifo q m whereSource

Construct a new FIFO queue. I don't know whether or not I really want
the `a`

parameter. It might go away sometime, so beware ;-).

class Monad m => DefaultFifo q m a | q -> a, m a -> qSource

A type class carrying an altered set of functional dependencies used to constrain queues when the type of the queue never escapes far enough for a more deliberate choice to be made.

DefaultFifo (TChan a) IO a | |

DefaultFifo (TChan a) STM a |

newDefaultFifoFor :: (DefaultFifo q m a, NewFifo q m) => a -> m qSource

Construct a new FIFO of a type suitable for carrying the supplied thing. Does not actually do anything with the thing supplied.

class Monad m => DequeueWhere q m a | q -> a whereSource

dequeueWhere :: q -> (a -> Bool) -> m (Maybe a)Source

Pull an item matching the given predicate out of a queue.

class Monad m => PeekQueue q m a | q -> a whereSource

return the whole contents of the queue (if possible) without altering the queue's contents. Obviously in cases where this can't be done lazily this can be a very expensive operation.

peekQueueTaking :: Int -> q -> m [a]Source

peek a specified number of items off the queue. The default implementation is hideously wasteful in cases where peekQueue is not able to get the contents lazily.