Copyright | (c) Masahiro Sakai 2012 |
---|---|
License | BSD-style |
Maintainer | masahiro.sakai@gmail.com |
Stability | provisional |
Portability | non-portable (FlexibleInstances, MultiParamTypeClasses) |
Safe Haskell | Safe |
Language | Haskell2010 |
Queue implemented using IORef and Sequence.
SeqQueue type
Constructors
Operators
class Monad m => Enqueue q m a | q -> a where #
Put an item into a queue. May block while trying to do so.
No constraint is placed on the behavior of the queue except that
every item put in "really ought to" come out sometime before
dequeue
returns a Nothing
.
enqueueBatch :: q -> [a] -> m () #
class Monad m => Dequeue q m a | q -> a where #
Pull an item out of a queue. Should not block. No ordering
constraints are implied other than that any item that went into
the queue "really ought to" come out before dequeue
returns
Nothing
.
dequeueBatch :: q -> m [a] #