forsyde-shallow-3.4.0.0: ForSyDe's Haskell-embedded Domain Specific Language.

Copyright(c) ForSyDe Group KTH 2007-2008
LicenseBSD-style (see the file LICENSE)
Maintainerforsyde-dev@ict.kth.se
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell98

ForSyDe.Shallow.Utility.Queue

Description

This provides two data types, that can be used to model queue structures, such as FIFOs. There is a data type for an queue of infinite size Queue and one for finite size FiniteQueue.

Synopsis

Documentation

data Queue a Source #

A queue is modeled as a list. The data type Queue modelles an queue of infinite size.

Constructors

Q [a] 
Instances
Eq a => Eq (Queue a) Source # 
Instance details

Defined in ForSyDe.Shallow.Utility.Queue

Methods

(==) :: Queue a -> Queue a -> Bool #

(/=) :: Queue a -> Queue a -> Bool #

Show a => Show (Queue a) Source # 
Instance details

Defined in ForSyDe.Shallow.Utility.Queue

Methods

showsPrec :: Int -> Queue a -> ShowS #

show :: Queue a -> String #

showList :: [Queue a] -> ShowS #

data FiniteQueue a Source #

The data type FiniteQueue has an additional parameter, that determines the size of the queue.

Constructors

FQ Int [a] 
Instances
Eq a => Eq (FiniteQueue a) Source # 
Instance details

Defined in ForSyDe.Shallow.Utility.Queue

Show a => Show (FiniteQueue a) Source # 
Instance details

Defined in ForSyDe.Shallow.Utility.Queue

pushQ :: Queue a -> a -> Queue a Source #

pushQ pushes one element into an infinite queue.

pushListQ :: Queue a -> [a] -> Queue a Source #

pushListQ pushes a list of elements into an infinite queue.

popQ :: Queue a -> (Queue a, AbstExt a) Source #

popQ pops one element from an infinite queue.

queue :: [a] -> Queue a Source #

queue transforms a list into an infinite queue.

pushFQ :: FiniteQueue a -> a -> FiniteQueue a Source #

pushFQ pushes one element into a finite queue.

pushListFQ :: FiniteQueue a -> [a] -> FiniteQueue a Source #

pushListFQ pushes a list of elements into a finite queue.

popFQ :: FiniteQueue a -> (FiniteQueue a, AbstExt a) Source #

popFQ pops one element from a finite queue.

finiteQueue :: Int -> [a] -> FiniteQueue a Source #

finiteQueue transforms a list into an infinite queue.