control-monad-queue-0.0.9: Resuable corecursive queues, via continuations.

Maintainerleon at melding-monads dot com



A library implementation of corecursive queues, see Circular Programs and Self-Referential Structures by Lloyd Allison, Software Practice and Experience, 19(2), pp.99-109, Feb 1989

For an explanation of the library implementation, see Lloyd Allison's Corecursive Queue: Why Continuations Matter by Leon P Smith, in The Monad Reader issue 14.


data Q e a Source


MonadQueue e (Q e) 
Monad (Q e) 

enQ :: e -> Q e ()Source

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

peekQs :: Integral len => len -> Q e [e]Source

deQ :: Q e (Maybe e)Source

deQs :: Integral len => len -> Q e [e]Source

lenQ :: Integral len => Q e lenSource

runQueue :: Q e a -> [e]Source

callCC :: ((a -> forall b. Q e b) -> Q e a) -> Q e aSource