@@ -227,3 +227,6 @@ switchPromptly ea0 eea = do
227227instance Reflex t => Align (Event t) where
228228 nil = never
229229 align ea eb = fmapMaybe dmapToThese $ merge $ DMap.fromList [WrapArg LeftTag :=> ea, WrapArg RightTag :=> eb]
230+
231+gate :: Reflex t => Behavior t Bool -> Event t a -> Event t a
232+gate = attachWithMaybe $ \allow a -> if allow then Just a else Nothing