on develop help sign in
Add default implementation of `now` for transformed monads.
commitf6dc861d6abd16b934f257ea2086baa77a7e6b42 authorAdriaan Leijnse <parenthetical@users.noreply.github.com> dateMon 11 May 2020, 15:15 (6 years ago) parent21f8a7e
1 file changed+2
src/Reflex/Class.hs+2
src/Reflex/Class.hs+2
@@ -422,6 +422,8 @@ class MonadSample t m => MonadHold t m where
422422 headE :: Event t a -> m (Event t a)
423423 -- | An event which occurs at the current moment.
424424 now :: m (Event t ())
425+ default now :: (m ~ f m', MonadTrans f, MonadHold t m') => m (Event t ())
426+ now = lift now
425427
426428-- | Accumulate an 'Incremental' with the supplied initial value and the firings of the provided 'Event',
427429-- using the combining function to produce a patch.