Portability | non-portable (TF,GNTD) |
---|---|
Stability | experimental |
Maintainer | hans@hanshoglund.se |
Safe Haskell | None |
Reactive values, or piecewise functions of time.
Similar to Conal's definition in http://conal.net/blog/posts/reactive-normal-form,
but defined in negative time as well. Its semantics function is either occs
&&&
?
or initial
&&&
updates
, where intial
is the value from negative infinity
to the first update.
TODO integrate better in the library
Documentation
Functor Reactive | |
Applicative Reactive | |
HasBehavior Reactive | |
Enum a => Enum (Reactive a) | |
Eq (Reactive b) | |
Floating b => Floating (Reactive b) | |
Fractional b => Fractional (Reactive b) | |
Integral a => Integral (Reactive a) | |
Num a => Num (Reactive a) | |
Ord b => Ord (Reactive b) | |
(Num a, Ord a) => Real (Reactive a) | |
IsString a => IsString (Reactive a) | |
Monoid a => Monoid (Reactive a) | |
Semigroup a => Semigroup (Reactive a) | |
Wrapped (Reactive a) | |
VectorSpace v => VectorSpace (Reactive v) | |
AdditiveGroup v => AdditiveGroup (Reactive v) | |
Delayable (Reactive a) | |
Stretchable (Reactive a) |
Create, isos etc (TODO)
updates :: Reactive a -> [Future a]Source
Get the time of all updates and the value switched to at this point.
Predicates
isConstant :: Reactive a -> BoolSource
isVariable :: Reactive a -> BoolSource
Combinators
switch :: Time -> Reactive a -> Reactive a -> Reactive aSource
switch t a b
behaves as a
before time t
, then as b
.
trim :: Monoid a => Span -> Reactive a -> Reactive aSource
Replace everthing outside the given span by mempty
.