on develop help sign in
Add an example of `now` semantics in the description.
502b508Adriaan Leijnse
src/Reflex/Class.hs+4−1
@@ -420,7 +420,10 @@ class MonadSample t m => MonadHold t m where
420 -- | Create a new 'Event' that only occurs only once, on the first occurrence of
420 -- | Create a new 'Event' that only occurs only once, on the first occurrence of
421 -- the supplied 'Event'.
421 -- the supplied 'Event'.
422 headE :: Event t a -> m (Event t a)
422 headE :: Event t a -> m (Event t a)
423− -- | An event which occurs at the current moment.
423+ -- | An event which only occurs at the current moment in time, such that:
424+ --
425+ -- > coincidence (pushAlways (\a -> (a <$) <$> now) e) = e
426+ --
424 now :: m (Event t ())
427 now :: m (Event t ())
425 default now :: (m ~ f m', MonadTrans f, MonadHold t m') => m (Event t ())
428 default now :: (m ~ f m', MonadTrans f, MonadHold t m') => m (Event t ())
426 now = lift now
429 now = lift now