Skip to content

Instantly share code, notes, and snippets.

@jfischoff
Created August 21, 2019 06:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jfischoff/3125908955980d24d8936fbb71662bbd to your computer and use it in GitHub Desktop.
Save jfischoff/3125908955980d24d8936fbb71662bbd to your computer and use it in GitHub Desktop.
delayOne :: (MonadHold t m, Reflex t) => Event t a -> m (Event t (a, a))
delayOne e = do
b <- hold Nothing $ Just <$> e
let eOld = W.catMaybes $ b <@ e
pure $ liftF2 (,) eOld e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment