Safe Haskell | None |
---|---|
Language | Haskell2010 |
Helper functions for dealing with events
Synopsis
- eventJoin :: (Reflex t, MonadHold t m) => Event t (Event t a) -> m (Event t a)
- switchTup :: Reflex t => Dynamic t (Event t b, Event t c) -> (Event t b, Event t c)
- holdEvent :: (DomBuilder t m, MonadHold t m) => b -> Event t a -> (a -> m b) -> m (Dynamic t b)
- holdEvent_ :: (DomBuilder t m, MonadHold t m) => Event t a -> (a -> m b) -> m ()
- holdAfter :: (PostBuild t m, DomBuilder t m, MonadHold t m, PerformEvent t m, TriggerEvent t m, MonadIO (Performable m)) => b -> Event t a -> (a -> Event t a -> m b) -> m (Dynamic t b)
- flash :: (Monoid c, DomBuilder t m, PerformEvent t m, MonadHold t m, TriggerEvent t m, MonadIO (Performable m)) => Event t b -> (b -> m c) -> m (Dynamic t c)
- flash' :: (DomBuilder t m, PerformEvent t m, MonadHold t m, TriggerEvent t m, MonadIO (Performable m)) => NominalDiffTime -> c -> Event t b -> (b -> m c) -> m (Dynamic t c)
- evtText :: (DomBuilder t m, PostBuild t m, MonadHold t m) => Event t Text -> m ()
- noNothing :: (Filterable f, Filterable f) => f (Maybe a) -> f a
- gatePrism :: Reflex t => Prism' a b -> Event t a -> Event t b
- blockFalse :: Reflex t => Event t Bool -> Event t ()
Documentation
switchTup :: Reflex t => Dynamic t (Event t b, Event t c) -> (Event t b, Event t c) Source #
Get rid of a dynimc around a tupple of events, common sense says we should be able to do this for any traversable, but keeping the values of events hetrogenous is hard (I don't know how to)
Hold
holdEvent :: (DomBuilder t m, MonadHold t m) => b -> Event t a -> (a -> m b) -> m (Dynamic t b) Source #
Do something monadic with an event val Because of haskell lazyness the things inside a holdevent don't get evaluated untill the event fires, which makes the first time slow. However it is good for initialization as we don't need to load things unused.
holdEvent_ :: (DomBuilder t m, MonadHold t m) => Event t a -> (a -> m b) -> m () Source #
Convenience holdEvent for the case where we don't care about the value.
holdAfter :: (PostBuild t m, DomBuilder t m, MonadHold t m, PerformEvent t m, TriggerEvent t m, MonadIO (Performable m)) => b -> Event t a -> (a -> Event t a -> m b) -> m (Dynamic t b) Source #
Do something monadic with an event val, and get the event which is delayed for a moment. Using this may indicate you're doing something weird. Although I've found it handy in getting just something to work
Flash
flash :: (Monoid c, DomBuilder t m, PerformEvent t m, MonadHold t m, TriggerEvent t m, MonadIO (Performable m)) => Event t b -> (b -> m c) -> m (Dynamic t c) Source #
show something for 5 seconds after an event
flash' :: (DomBuilder t m, PerformEvent t m, MonadHold t m, TriggerEvent t m, MonadIO (Performable m)) => NominalDiffTime -> c -> Event t b -> (b -> m c) -> m (Dynamic t c) Source #
Display
Gate
noNothing :: (Filterable f, Filterable f) => f (Maybe a) -> f a Source #
Block those nothing events and only let trough Just
values