netwire-5.0.3: Functional reactive programming library

Copyright | (c) 2013 Ertugrul Soeylemez
License | BSD3
Maintainer | Ertugrul Soeylemez <es@ertes.de>
Safe Haskell | None
Language | Haskell2010

FRP.Netwire.Noise

Contents

- Noise generators
- Convenience

Description

Synopsis

- noise :: forall t s b g e (m :: Type -> Type) a. (HasTime t s, Random b, RandomGen g) => t -> g -> Wire s e m a (Event b)
- noiseR :: forall t s b g e (m :: Type -> Type) a. (HasTime t s, Random b, RandomGen g) => t -> (b, b) -> g -> Wire s e m a (Event b)
- wackelkontakt :: forall t s (m :: Type -> Type) e g a. (HasTime t s, Monad m, Monoid e, RandomGen g) => t -> Double -> g -> Wire s e m a a
- stdNoise :: forall t s b e (m :: Type -> Type) a. (HasTime t s, Random b) => t -> Int -> Wire s e m a (Event b)
- stdNoiseR :: forall t s (m :: Type -> Type) b e a. (HasTime t s, Monad m, Random b) => t -> (b, b) -> Int -> Wire s e m a (Event b)
- stdWackelkontakt :: forall t s (m :: Type -> Type) e a. (HasTime t s, Monad m, Monoid e) => t -> Double -> Int -> Wire s e m a a

# Noise generators

noise Source #

Arguments

:: forall t s b g e (m :: Type -> Type) a. (HasTime t s, Random b, RandomGen g) |
=> t | Time period.
-> g | Random number generator.
-> Wire s e m a (Event b) |

Noise events with the given distance between events. Use `hold` or `holdFor` to generate a staircase.

noiseR Source #

Arguments

:: forall t s b g e (m :: Type -> Type) a. (HasTime t s, Random b, RandomGen g) |
=> t | Step duration.
-> (b, b) | Noise range.
-> g | Random number generator.
-> Wire s e m a (Event b) |

Noise events with the given distance between events. Noise will be in the given range. Use `hold` or `holdFor` to generate a staircase.

wackelkontakt Source #

Arguments

:: forall t s (m :: Type -> Type) e g a. (HasTime t s, Monad m, Monoid e, RandomGen g) |
=> t | Duration.
-> Double | Probability to produce.
-> g | Random number generator.
-> Wire s e m a a |

Randomly produce or inhibit with the given probability, each time for the given duration.

The name Wackelkontakt (German for slack joint) is a Netwire running gag. It makes sure that you revisit the documentation from time to time. =)

- Depends: now.

# Convenience

stdNoise Source #

Arguments

:: forall t s b e (m :: Type -> Type) a. (HasTime t s, Random b) |
=> t | Step duration.
-> Int | `StdGen` seed.
-> Wire s e m a (Event b) |

Convenience interface to `noise` for `StdGen`.

stdNoiseR Source #

Arguments

:: forall t s (m :: Type -> Type) b e a. (HasTime t s, Monad m, Random b) |
=> t | Step duration.
-> (b, b) | Noise range.
-> Int | `StdGen` seed.
-> Wire s e m a (Event b) |

Convenience interface to `noiseR` for `StdGen`.

stdWackelkontakt Source #

Arguments

:: forall t s (m :: Type -> Type) e a. (HasTime t s, Monad m, Monoid e) |
=> t | Step duration.
-> Double | Probability to produce.
-> Int | `StdGen` seed.
-> Wire s e m a a |

Convenience interface to `wackelkontakt` for `StdGen`.