Copyright | (c) ForSyDe Group KTH 2007-2008 |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | forsyde-dev@ict.kth.se |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell98 |
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
- data Queue a = Q [a]
- data FiniteQueue a = FQ Int [a]
- pushQ :: Queue a -> a -> Queue a
- pushListQ :: Queue a -> [a] -> Queue a
- popQ :: Queue a -> (Queue a, AbstExt a)
- queue :: [a] -> Queue a
- pushFQ :: FiniteQueue a -> a -> FiniteQueue a
- pushListFQ :: FiniteQueue a -> [a] -> FiniteQueue a
- popFQ :: FiniteQueue a -> (FiniteQueue a, AbstExt a)
- finiteQueue :: Int -> [a] -> FiniteQueue a
Documentation
A queue is modeled as a list. The data type Queue
modelles an
queue of infinite size.
Q [a] |
data FiniteQueue a Source #
The data type FiniteQueue
has an additional parameter, that
determines the size of the queue.
Instances
Eq a => Eq (FiniteQueue a) Source # | |
Defined in ForSyDe.Shallow.Utility.Queue (==) :: FiniteQueue a -> FiniteQueue a -> Bool # (/=) :: FiniteQueue a -> FiniteQueue a -> Bool # | |
Show a => Show (FiniteQueue a) Source # | |
Defined in ForSyDe.Shallow.Utility.Queue showsPrec :: Int -> FiniteQueue a -> ShowS # show :: FiniteQueue a -> String # showList :: [FiniteQueue a] -> ShowS # |
pushListQ :: Queue a -> [a] -> Queue a Source #
pushListQ
pushes a list of elements 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.