Created
July 3, 2018 14:05
-
-
Save oliver-batchelor/c982355133b6c1ee90de999517ca73a8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
timeout :: MonadWidget t m => (Event t a, Event t a) -> NominalDiffTime -> m (Event t a) | |
timeout (down, up) time = do | |
delayed <- delay time down | |
let timedOut = flip pushAlways down $ const $ mdo | |
isDown <- hold True (False <$ leftmost [up, delayed]) | |
return $ gate isDown delayed | |
switchHold never timedOut |
Author
oliver-batchelor
commented
Jul 3, 2018
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment