netwire-4.0.7: Flexible wire arrows for FRP

MaintainerErtugrul Soeylemez <es@ertes.de>
Safe HaskellNone

Control.Wire.Prefab.Effect

Contents

Description

Effectful wires.

Synopsis

Monadic effects

Simple

perform :: Monad m => Wire e m (m b) bSource

Perform the input monadic action in a wire.

  • Depends: current instant.

Exception-aware

execute :: MonadBaseControl IO m => Wire LastException m (m a) aSource

Variant of executeWith for the LastException inhibition monoid.

  • Depends: current instant.
  • Inhibits: when the action throws an exception.

execute_ :: MonadBaseControl IO m => (a -> m b) -> Wire LastException m a bSource

Variant of executeWith_ for the LastException inhibition monoid.

  • Depends: current instant, if the given function is strict.
  • Inhibits: when the action throws an exception.

executeWithSource

Arguments

:: MonadBaseControl IO m 
=> (SomeException -> e)

Turns an exception into an inhibition value.

-> Wire e m (m a) a 

Perform the input monadic action at every instant.

  • Depends: current instant.
  • Inhibits: when the action throws an exception.

executeWith_Source

Arguments

:: MonadBaseControl IO m 
=> (SomeException -> e)

Turns an exception into an inhibition value.

-> (a -> m b)

Action to perform.

-> Wire e m a b 

Perform the given monadic action at every instant.

  • Depends: current instant, if the given function is strict.
  • Inhibits: when the action throws an exception.

Branching

branch :: MonadPlus m => Wire e m [a] aSource

Branch according to the unterlying MonadPlus instance. Note that this wire branches at every instant.

  • Depends: current instant.

quit :: MonadPlus m => Wire e m a bSource

Quits the current branch using mzero.

quitWith :: MonadPlus m => Wire e m a aSource

Acts like identity in the first instant, then quits the current branch using mzero.

  • Depends: first instant.