control-monad-queue-0.2.0.1: Reusable corecursive queues, via continuations.

Copyright(c) Leon P Smith 2009
LicenseBSD3
Maintainerleon at melding-monads dot com
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell98

Control.Monad.Queue.Class

Description

 

Documentation

class Monad q => MonadQueue e q | q -> e where Source

Minimal complete definition

enQ, peekQ, peekQs, peekQn, lenQ

Methods

enQ :: e -> q () Source

Enqueue an element to a queue

deQ :: q (Maybe e) Source

Dequeue an element, returns Nothing if the queue is empty.

deQs :: Integral maxlen => maxlen -> q [e] Source

Dequeue up to maxlen elements.

peekQ :: q (Maybe e) Source

Examines the front element of the queue without removing it.

peekQs :: Integral maxlen => maxlen -> q [e] Source

Examines up to maxlen elements of the queue without removing them.

peekQn :: Integral index => index -> q (Maybe e) Source

Examines the element currently at position index, indexing starts at 0.

lenQ :: Integral len => q len Source

Returns the current length of the queue

Instances