@@ -42,11 +42,14 @@ main = do
4242 print os4
4343 os5 <- runApp' (unwrapApp testLiveRequestDMap) [Just ()]
4444 print os5
45+ os6 <- runApp' (unwrapApp delayedPulse) [Just ()]
46+ print os6
4547 let ![[Just [10,9,8,7,6,5,4,3,2,1]]] = os1
4648 let ![[Just [1,3,5,7,9]],[Nothing,Nothing],[Just [2,4,6,8,10]],[Just [2,4,6,8,10],Nothing]] = os2
4749 let ![[Nothing, Just [2]]] = os3
4850 let ![[Nothing, Just [2]]] = os4
4951 let ![[Nothing, Just [1, 2]]] = os5
52+ let ![[Nothing, Nothing]] = os6
5053 return ()
5154
5255unwrapRequest :: DSum tag RequestInt -> Int
@@ -146,3 +149,21 @@ testLiveRequestDMap pulse = do
146149 (mapToDMap $ M.singleton 1 ())
147150 ((PatchDMap $ DMap.map (ComposeMaybe . Just) $ mapToDMap $ M.singleton 2 ()) <$ pulse)
148151 return ()
152+
153+delayedPulse
154+ :: forall t m
155+ . ( Reflex t
156+ , Adjustable t m
157+ , MonadHold t m
158+ , MonadFix m
159+ , Response m ~ Identity
160+ , Request m ~ RequestInt
161+ , PerformEvent t m
162+ , Requester t m
163+ )
164+ => Event t ()
165+ -> m ()
166+delayedPulse pulse = void $ flip runWithReplace (pure () <$ pulse) $ do
167+ -- This has the effect of delaying pulse' from pulse
168+ (_, pulse') <- runWithReplace (pure ()) $ pure (RequestInt 1) <$ pulse
169+ requestingIdentity pulse'