toysolver-0.3.0: Assorted decision procedures for SAT, Max-SAT, PB, MIP, etc

Copyright(c) Masahiro Sakai 2012
LicenseBSD-style
Maintainermasahiro.sakai@gmail.com
Stabilityprovisional
Portabilitynon-portable (FlexibleInstances, MultiParamTypeClasses)
Safe HaskellSafe-Inferred
LanguageHaskell2010

ToySolver.Internal.Data.SeqQueue

Contents

Description

Queue implemented using IORef and Sequence.

Synopsis

SeqQueue type

Constructors

class Monad m => NewFifo q m where

Construct a new FIFO queue.

Methods

newFifo :: m q

Operators

class Monad m => Enqueue q m a | q -> a where

Minimal complete definition

enqueue

Methods

enqueue :: q -> a -> m ()

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 ()

Instances

class Monad m => Dequeue q m a | q -> a where

Minimal complete definition

dequeue

Methods

dequeue :: q -> m (Maybe a)

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]

Instances

class Monad m => QueueSize q m where

Methods

queueSize :: q -> m Int

return the number of elements in the queue

clear :: SeqQueue a -> IO () Source