netwire-4.0.1: Flexible wire arrows for FRP

Copyright(c) 2012 Ertugrul Soeylemez
LicenseBSD3
MaintainerErtugrul Soeylemez <es@ertes.de>
Safe HaskellNone
LanguageHaskell2010

Control.Wire.Prefab.Queue

Contents

Description

Wires acting as queues.

Synopsis

Queues

bag :: (Monoid e, Ord b) => Wire e m (Set b) b Source

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] b Source

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] b Source

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.