@@ -262,8 +262,6 @@ class ( MonadHold t (PushM t)
262 never :: Event t a
262 never :: Event t a
263 -- | Create a 'Behavior' that always has the given value
263 -- | Create a 'Behavior' that always has the given value
264 constant :: a -> Behavior t a --TODO: Refactor to use 'pure' from Applicative instead; however, we need to make sure that encouraging Applicative-style use of 'Behavior's doesn't have a negative performance impact
264 constant :: a -> Behavior t a --TODO: Refactor to use 'pure' from Applicative instead; however, we need to make sure that encouraging Applicative-style use of 'Behavior's doesn't have a negative performance impact
265− -- | An event which occurs at the current moment.
266− now :: PushM t (Event t ())
267 -- | Create an 'Event' from another 'Event'; the provided function can sample
265 -- | Create an 'Event' from another 'Event'; the provided function can sample
268 -- 'Behavior's and hold 'Event's, and use the results to produce a occurring
266 -- 'Behavior's and hold 'Event's, and use the results to produce a occurring
269 -- (Just) or non-occurring (Nothing) result
267 -- (Just) or non-occurring (Nothing) result
@@ -422,6 +420,8 @@ class MonadSample t m => MonadHold t m where
422 -- | 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
423 -- the supplied 'Event'.
421 -- the supplied 'Event'.
424 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.
424+ now :: m (Event t ())
426-- | Accumulate an 'Incremental' with the supplied initial value and the firings of the provided 'Event',
426-- | Accumulate an 'Incremental' with the supplied initial value and the firings of the provided 'Event',
427-- using the combining function to produce a patch.
427-- using the combining function to produce a patch.
@@ -567,6 +567,7 @@ instance MonadHold t m => MonadHold t (ReaderT r m) where
567 holdIncremental a0 = lift . holdIncremental a0
567 holdIncremental a0 = lift . holdIncremental a0
568 buildDynamic a0 = lift . buildDynamic a0
568 buildDynamic a0 = lift . buildDynamic a0
569 headE = lift . headE
569 headE = lift . headE
571instance (MonadSample t m, Monoid r) => MonadSample t (WriterT r m) where
572instance (MonadSample t m, Monoid r) => MonadSample t (WriterT r m) where
572 sample = lift . sample
573 sample = lift . sample
@@ -577,6 +578,7 @@ instance (MonadHold t m, Monoid r) => MonadHold t (WriterT r m) where
577 holdIncremental a0 = lift . holdIncremental a0
578 holdIncremental a0 = lift . holdIncremental a0
578 buildDynamic a0 = lift . buildDynamic a0
579 buildDynamic a0 = lift . buildDynamic a0
579 headE = lift . headE
580 headE = lift . headE
581instance MonadSample t m => MonadSample t (StateT s m) where
583instance MonadSample t m => MonadSample t (StateT s m) where
582 sample = lift . sample
584 sample = lift . sample
@@ -587,6 +589,7 @@ instance MonadHold t m => MonadHold t (StateT s m) where
587 holdIncremental a0 = lift . holdIncremental a0
589 holdIncremental a0 = lift . holdIncremental a0
588 buildDynamic a0 = lift . buildDynamic a0
590 buildDynamic a0 = lift . buildDynamic a0
589 headE = lift . headE
591 headE = lift . headE
591instance MonadSample t m => MonadSample t (ExceptT e m) where
594instance MonadSample t m => MonadSample t (ExceptT e m) where
592 sample = lift . sample
595 sample = lift . sample
@@ -597,6 +600,7 @@ instance MonadHold t m => MonadHold t (ExceptT e m) where
597 holdIncremental a0 = lift . holdIncremental a0
600 holdIncremental a0 = lift . holdIncremental a0
598 buildDynamic a0 = lift . buildDynamic a0
601 buildDynamic a0 = lift . buildDynamic a0
599 headE = lift . headE
602 headE = lift . headE
601instance (MonadSample t m, Monoid w) => MonadSample t (RWST r w s m) where
605instance (MonadSample t m, Monoid w) => MonadSample t (RWST r w s m) where
602 sample = lift . sample
606 sample = lift . sample
@@ -607,6 +611,7 @@ instance (MonadHold t m, Monoid w) => MonadHold t (RWST r w s m) where
607 holdIncremental a0 = lift . holdIncremental a0
611 holdIncremental a0 = lift . holdIncremental a0
608 buildDynamic a0 = lift . buildDynamic a0
612 buildDynamic a0 = lift . buildDynamic a0
609 headE = lift . headE
613 headE = lift . headE
611instance MonadSample t m => MonadSample t (ContT r m) where
616instance MonadSample t m => MonadSample t (ContT r m) where
612 sample = lift . sample
617 sample = lift . sample
@@ -617,6 +622,7 @@ instance MonadHold t m => MonadHold t (ContT r m) where
617 holdIncremental a0 = lift . holdIncremental a0
622 holdIncremental a0 = lift . holdIncremental a0
618 buildDynamic a0 = lift . buildDynamic a0
623 buildDynamic a0 = lift . buildDynamic a0
619 headE = lift . headE
624 headE = lift . headE
621--------------------------------------------------------------------------------
627--------------------------------------------------------------------------------
622-- Convenience functions
628-- Convenience functions