on develop help sign in
Add default implementation of `now` for transformed monads.
f6dc861Adriaan Leijnse
src/Reflex/Class.hs+2
@@ -422,6 +422,8 @@ class MonadSample t m => MonadHold t m where
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 occurs at the current moment.
424 now :: m (Event t ())
424 now :: m (Event t ())
425+ default now :: (m ~ f m', MonadTrans f, MonadHold t m') => m (Event t ())
426+ now = lift now
425
427
426-- | Accumulate an 'Incremental' with the supplied initial value and the firings of the provided 'Event',
428-- | Accumulate an 'Incremental' with the supplied initial value and the firings of the provided 'Event',
427-- using the combining function to produce a patch.
429-- using the combining function to produce a patch.