You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
--| Create an 'Event' that will occur whenever the currently-selected input
287
288
-- 'Event' occurs
288
289
switch::Behaviort (Eventta) ->Eventta
289
-
--| Create an 'Event' that will occur whenever the input event is occurring -- and its occurrence value, another 'Event', is also occurring
290
+
--| Create an 'Event' that will occur whenever the input event is occurring -- and its occurrence value, another 'Event', is also occurring.
291
+
-- You maybe looking for '@switchHold@ @never@' instead.
290
292
coincidence::Eventt (Eventta) ->Eventta
291
293
--| Extract the 'Behavior' of a 'Dynamic'.
292
294
current::Dynamicta->Behaviorta
@@ -662,7 +664,9 @@ instance Reflex t => Monad (Behavior t) where
662
664
a >>= f = pull $ sample a >>= sample . f
663
665
-- Note: it is tempting to write (_ >> b = b); however, this would result in (fail x >> return y) succeeding (returning y), which violates the law that (a >> b = a >>= \_ -> b), since the implementation of (>>=) above actually will fail. Since we can't examine 'Behavior's other than by using sample, I don't think it's possible to write (>>) to be more efficient than the (>>=) above.
664
666
return= constant
667
+
#if !MIN_VERSION_base(4,13,0)
665
668
fail=error"Monad (Behavior t) does not support fail"
669
+
#endif
666
670
667
671
instance (Reflext, Monoida) =>Monoid (Behaviorta) where
0 commit comments