@@ -42,11 +42,14 @@ main = do
43 os5 <- runApp' (unwrapApp testLiveRequestDMap) [Just ()]
43 os5 <- runApp' (unwrapApp testLiveRequestDMap) [Just ()]
45+ os6 <- runApp' (unwrapApp delayedPulse) [Just ()]
45 let ![[Just [10,9,8,7,6,5,4,3,2,1]]] = os1
47 let ![[Just [10,9,8,7,6,5,4,3,2,1]]] = os1
46 let ![[Just [1,3,5,7,9]],[Nothing,Nothing],[Just [2,4,6,8,10]],[Just [2,4,6,8,10],Nothing]] = os2
48 let ![[Just [1,3,5,7,9]],[Nothing,Nothing],[Just [2,4,6,8,10]],[Just [2,4,6,8,10],Nothing]] = os2
47 let ![[Nothing, Just [2]]] = os3
49 let ![[Nothing, Just [2]]] = os3
48 let ![[Nothing, Just [2]]] = os4
50 let ![[Nothing, Just [2]]] = os4
49 let ![[Nothing, Just [1, 2]]] = os5
51 let ![[Nothing, Just [1, 2]]] = os5
52+ let ![[Nothing, Nothing]] = os6
52unwrapRequest :: DSum tag RequestInt -> Int
55unwrapRequest :: DSum tag RequestInt -> Int
@@ -146,3 +149,21 @@ testLiveRequestDMap pulse = do
146 (mapToDMap $ M.singleton 1 ())
149 (mapToDMap $ M.singleton 1 ())
147 ((PatchDMap $ DMap.map (ComposeMaybe . Just) $ mapToDMap $ M.singleton 2 ()) <$ pulse)
150 ((PatchDMap $ DMap.map (ComposeMaybe . Just) $ mapToDMap $ M.singleton 2 ()) <$ pulse)
148 return ()
151 return ()
159+ , Response m ~ Identity
160+ , Request m ~ RequestInt
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'