Maintainer | Ertugrul Soeylemez <es@ertes.de> |
---|---|
Safe Haskell | None |
Wires acting as queues.
Queues
bag :: (Monoid e, Ord b) => Wire e m (Set b) bSource
Incoming values are placed in a set, which is discharged element by element. Lower values are served first. Duplicate values are served once.
Note: Incorrect usage can lead to congestion.
- Complexity: O(n) space wrt bag size.
- Depends: current instant.
- Inhibits: when the bag is empty.
fifo :: Monoid e => Wire e m [b] bSource
First in, first out. The input list is placed on the right end of a queue at every instant, giving earlier elements a higher priority. The queue is discharged item by item from the left.
Note: Incorrect usage can lead to congestion.
- Complexity: O(n) space wrt queue size.
- Depends: current instant.
- Inhibits: when the queue is currently empty.
lifo :: Monoid e => Wire e m [b] bSource
Last in, first out. The input list is placed on a stack at every instant, giving earlier elements a higher priority. The stack is discharged item by item from the top.
Note: Incorrect usage can lead to congestion.
- Complexity: O(n) space wrt stack size.
- Depends: current instant.
- Inhibits: when the stack is currently empty.