reflex-animation-0.1.5: Continuous animations support for reflex

Safe HaskellNone
LanguageHaskell2010

Reflex.Monad.Time

Synopsis

Documentation

class (MonadReflex t m, RealFrac time) => MonadTime t time m | m -> t time where Source

Methods

getTime :: m (Behavior t time) Source

A behavior for time, must be up to date (i.e. represents current time not previous time)

after :: time -> m (Event t ()) Source

Fire an event at or just after a period of time

delay :: Event t (a, time) -> m (Event t (NonEmpty a)) Source

Delay an event by a period of time, returns a list in case two delayed events occur within the sampling rate of the framework

delay_ :: MonadTime t time m => Event t time -> m (Event t ()) Source

Delay a void event stream

animate :: (Reflex t, RealFrac time) => Animation time a -> Behavior t time -> Behavior t a Source

Animate an infinite animation using framework time

animateClip :: (Reflex t, RealFrac time) => Clip time a -> Behavior t time -> Behavior t (Maybe a) Source

Sample a Clip during it's period, outside it's period return Nothing

animateOn :: (Reflex t, RealFrac time) => Event t (Animation time a) -> Behavior t time -> Event t (Behavior t a) Source

Create a Behavior from an infinite animation on the occurance of the event

play :: MonadTime t time m => Animation time a -> m (Behavior t a) Source

Play an infinite animation starting now

playClip :: MonadTime t time m => Clip time a -> m (Behavior t (Maybe a), Event t ()) Source

Play an animation clip, giving a Behavior of it's value and an Event firing as it finishes

playClamp :: MonadTime t time m => Clip time a -> m (Behavior t a, Event t ()) Source

Play an animation clip, except clamp the ends so the Behavior is no longer 'Maybe a'

playOn :: MonadTime t time m => Event t (Clip time a) -> m (Behavior t (Maybe a), Event t ()) Source

Play an animation clip starting on the occurance of an Event if another play event occurs before the last one has finished, switch to that one instead.

match :: (Reflex t, Eq a) => a -> Event t a -> Event t () Source

Helper functions using filter with Eq

matchBy :: Reflex t => (a -> Bool) -> Event t a -> Event t () Source

pushFor :: Reflex t => Event t a -> (a -> PushM t b) -> Event t b Source

Helper for pushAlways