packages feed

reactive 0.10.2 → 0.10.3

raw patch · 2 files changed

+4/−4 lines, 2 files

Files

reactive.cabal view
@@ -1,5 +1,5 @@ Name:                reactive-Version:             0.10.2+Version:             0.10.3 Synopsis:            Simple foundation for functional reactive programming Category:            reactivity, FRP Description:
src/FRP/Reactive/Behavior.hs view
@@ -143,9 +143,9 @@  -- | Filter an event according to whether a reactive boolean is true. -- --- > whenE :: Event a -> Behavior Bool -> Event a-whenE :: Ord t => EventI t a -> BehaviorI t Bool -> EventI t a-whenE e = joinMaybes . fmap h . flip snapshot e+-- > whenE :: Behavior Bool -> Event a -> Event a+whenE :: Ord t => BehaviorI t Bool -> EventI t a -> EventI t a+b `whenE` e = joinMaybes (h <$> (b `snapshot` e))  where    h (a,True)  = Just a    h (_,False) = Nothing