wires-0.2.1: Functional reactive programming library

Control.Wire.Varying

Description

Synopsis

Time-varying values

data Varying a Source #

A Varying is a behaviour combined with an event that tracks when the value changes.

Instances

 Source # Methods(>>=) :: Varying a -> (a -> Varying b) -> Varying b #(>>) :: Varying a -> Varying b -> Varying b #return :: a -> Varying a #fail :: String -> Varying a # Source # Methodsfmap :: (a -> b) -> Varying a -> Varying b #(<\$) :: a -> Varying b -> Varying a # Source # Methodspure :: a -> Varying a #(<*>) :: Varying (a -> b) -> Varying a -> Varying b #liftA2 :: (a -> b -> c) -> Varying a -> Varying b -> Varying c #(*>) :: Varying a -> Varying b -> Varying b #(<*) :: Varying a -> Varying b -> Varying a # Source # Methodsfold :: Monoid m => Varying m -> m #foldMap :: Monoid m => (a -> m) -> Varying a -> m #foldr :: (a -> b -> b) -> b -> Varying a -> b #foldr' :: (a -> b -> b) -> b -> Varying a -> b #foldl :: (b -> a -> b) -> b -> Varying a -> b #foldl' :: (b -> a -> b) -> b -> Varying a -> b #foldr1 :: (a -> a -> a) -> Varying a -> a #foldl1 :: (a -> a -> a) -> Varying a -> a #toList :: Varying a -> [a] #null :: Varying a -> Bool #length :: Varying a -> Int #elem :: Eq a => a -> Varying a -> Bool #maximum :: Ord a => Varying a -> a #minimum :: Ord a => Varying a -> a #sum :: Num a => Varying a -> a #product :: Num a => Varying a -> a # Bounded a => Bounded (Varying a) Source # Methods Floating a => Floating (Varying a) Source # Methodspi :: Varying a #exp :: Varying a -> Varying a #log :: Varying a -> Varying a #sqrt :: Varying a -> Varying a #(**) :: Varying a -> Varying a -> Varying a #logBase :: Varying a -> Varying a -> Varying a #sin :: Varying a -> Varying a #cos :: Varying a -> Varying a #tan :: Varying a -> Varying a #asin :: Varying a -> Varying a #acos :: Varying a -> Varying a #atan :: Varying a -> Varying a #sinh :: Varying a -> Varying a #cosh :: Varying a -> Varying a #tanh :: Varying a -> Varying a #asinh :: Varying a -> Varying a #acosh :: Varying a -> Varying a #atanh :: Varying a -> Varying a #log1p :: Varying a -> Varying a #expm1 :: Varying a -> Varying a #log1pexp :: Varying a -> Varying a #log1mexp :: Varying a -> Varying a # Fractional a => Fractional (Varying a) Source # Methods(/) :: Varying a -> Varying a -> Varying a #recip :: Varying a -> Varying a # Num a => Num (Varying a) Source # Methods(+) :: Varying a -> Varying a -> Varying a #(-) :: Varying a -> Varying a -> Varying a #(*) :: Varying a -> Varying a -> Varying a #negate :: Varying a -> Varying a #abs :: Varying a -> Varying a #signum :: Varying a -> Varying a # IsString a => IsString (Varying a) Source # Methods NFData a => NFData (Varying a) Source # Methodsrnf :: Varying a -> () #

changes :: Varying a -> Event a Source #

The change event of the given time-varying value.

value :: Varying a -> a Source #

The behaviour value of the given time-varying value.

Events

holdV :: Applicative m => a -> Wire m (Event a) (Varying a) Source #

Hold the latest occurrence of the given event starting with the given initial value. The value switch occurs in the next frame.

holdV' :: Applicative m => a -> Wire m (Event a) (Varying a) Source #

Hold the latest occurrence of the given event starting with the given initial value. The value switch occurs instantly.

scanV :: Applicative m => (a -> b -> b) -> b -> Wire m (Event a) (Varying b) Source #

Left scan and hold of the given event.

Controllers

animateV :: Applicative m => (a -> m b) -> Wire m (Varying a) (Varying b) Source #

Run the given action each time the given time-varying value changes.