netwire-3.1.0: Fast generic automaton arrow transformer for AFRP

MaintainerErtugrul Soeylemez <es@ertes.de>

Control.Wire.Trans.Sample

Contents

Description

Wire transformers for sampling wires.

Synopsis

Sampling

class Arrow >~ => WHold (>~) whereSource

Hold signals.

Methods

hold :: Wire e >~ a b -> Wire e >~ a bSource

Keeps the latest produced value.

  • Depends: Like argument wire.
  • Inhibits: Until first production.

holdWith :: b -> Wire e >~ a b -> Wire e >~ a bSource

Keeps the latest produced value. Produces the argument value until the argument wire starts producing.

  • Depends: Like argument wire.

Instances

Monad m => WHold (Kleisli m) 

class Arrow >~ => WSample t (>~) | >~ -> t whereSource

Samples the given wire at discrete time intervals. Only runs the input through the wire, when the next sampling interval starts.

  • Depends: Current instant (left), like argument wire at sampling intervals (right).
  • Inhibits: Starts inhibiting when argument wire inhibits. Keeps inhibiting until next sampling interval.

Methods

sample :: Wire e >~ a b -> Wire e >~ (a, t) bSource

Instances

(AdditiveGroup t, MonadClock t m, Ord t) => WSample t (Kleisli m) 

class Arrow >~ => WSampleInt (>~) whereSource

Samples the given wire at discrete frame count intervals. Only runs the input through the wire, when the next sampling interval starts.

  • Depends: Current instant (left), like argument wire at sampling intervals (right).
  • Inhibits: Starts inhibiting when argument wire inhibits. Keeps inhibiting until next sampling interval.

Methods

sampleInt :: Wire e >~ a b -> Wire e >~ (a, Int) bSource

Instances

class Arrow >~ => WSwallow (>~) whereSource

Waits for the argument wire to produce and then keeps the first produced value forever.

  • Depends: Like argument wire until first production. Then stops depending.
  • Inhibits: Until the argument wire starts producing.

Methods

swallow :: Wire e >~ a b -> Wire e >~ a bSource

Instances