Portability | portable |
---|---|

Stability | experimental |

Maintainer | forsyde-dev@ict.kth.se |

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`

.

- 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

data FiniteQueue a Source

The data type `FiniteQueue`

has an additional parameter, that determines the size of the queue.

Eq a => Eq (FiniteQueue a) | |

Show a => Show (FiniteQueue a) |

pushListQ :: Queue a -> [a] -> Queue aSource

`pushListQ`

pushes a list of elements into an infinite queue.

pushFQ :: FiniteQueue a -> a -> FiniteQueue aSource

`pushFQ`

pushes one element into a finite queue.

pushListFQ :: FiniteQueue a -> [a] -> FiniteQueue aSource

`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 aSource

`finiteQueue`

transforms a list into an infinite queue.