Portability | non-portable (TF,GNTD) |
---|---|

Stability | experimental |

Maintainer | hans@hanshoglund.se |

Safe Haskell | None |

- data Reactive a
- initial :: Reactive a -> a
- final :: Reactive a -> a
- intermediate :: Transformable a => Reactive a -> [Note a]
- discrete :: Reactive a -> Behavior a
- updates :: Reactive a -> [(Time, a)]
- occs :: Reactive a -> [Time]
- atTime :: Reactive a -> Time -> a
- splitReactive :: Reactive a -> Either a ((a, Time), [Note a], (Time, a))
- switchR :: Time -> Reactive a -> Reactive a -> Reactive a
- trimR :: Monoid a => Span -> Reactive a -> Reactive a
- continous :: Reactive (Segment a) -> Behavior a
- continousWith :: Segment (a -> b) -> Reactive a -> Behavior b
- sample :: [Time] -> Behavior a -> Reactive a

# Reactive type

Forms an applicative as per `Behavior`

, but only switches at discrete points.

Functor Reactive | |

Typeable1 Reactive | |

Applicative Reactive | |

Monoid a => Monoid (Reactive a) | |

Semigroup a => Semigroup (Reactive a) | |

Wrapped (Reactive a) | |

IsDynamics a => IsDynamics (Reactive a) | |

IsPitch a => IsPitch (Reactive a) | |

IsInterval a => IsInterval (Reactive a) | |

Augmentable a => Augmentable (Reactive a) | |

Alterable a => Alterable (Reactive a) | |

Transformable (Reactive a) | |

Rewrapped (Reactive a) (Reactive b) |

# Construction

intermediate :: Transformable a => Reactive a -> [Note a]Source

Get all intermediate values.

discrete :: Reactive a -> Behavior aSource

Realize a `Reactive`

value as a discretely changing behavior.

updates :: Reactive a -> [(Time, a)]Source

Deprecated:

Get the time of all updates and the value switched to at this point.

splitReactive :: Reactive a -> Either a ((a, Time), [Note a], (Time, a))Source

Deprecated:

Split a reactive into notes, as well as the values before and after the first/last update

# Combinators

switchR :: Time -> Reactive a -> Reactive a -> Reactive aSource

`switch t a b`

behaves as `a`

before time `t`

, then as `b`

.

# Sampling and discretization

continousWith :: Segment (a -> b) -> Reactive a -> Behavior bSource