ForSyDe.Shallow.Queue
 Portability portable Stability experimental Maintainer forsyde-dev@ict.kth.se
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
 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 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) Show a => Show (Queue a)
 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) Show a => Show (FiniteQueue a)
 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.