@@ -230,26 +230,26 @@ throttle t e = do
230 let f (immediate, buffer) x = case x of -- (Just newState, out)
230 let f (immediate, buffer) x = case x of -- (Just newState, out)
231 This a -- If only the input event fires
231 This a -- If only the input event fires
232 | immediate -> -- and we're in immediate mode
232 | immediate -> -- and we're in immediate mode
233− -- * Immediate mode turns off, and the buffer is empty.
233+ -- Immediate mode turns off, and the buffer is empty.
234− -- * We fire the output event with the input event value immediately.
234+ -- We fire the output event with the input event value immediately.
235 (Just (False, Nothing), Just a)
235 (Just (False, Nothing), Just a)
236 | otherwise -> -- and we're not in immediate mode
236 | otherwise -> -- and we're not in immediate mode
237− -- * Immediate mode remains off, and we replace the contents of the buffer (if any) with the input value.
237+ -- Immediate mode remains off, and we replace the contents of the buffer (if any) with the input value.
238− -- * We don't fire the output event.
238+ -- We don't fire the output event.
239 (Just (False, Just a), Nothing)
239 (Just (False, Just a), Nothing)
240 That _ -> -- If only the delayed output event fires,
240 That _ -> -- If only the delayed output event fires,
241 case buffer of
241 case buffer of
242 Nothing -> -- and the buffer is empty:
242 Nothing -> -- and the buffer is empty:
243− -- * Immediate mode turns back on, and the buffer remains empty.
243+ -- Immediate mode turns back on, and the buffer remains empty.
244− -- * We don't fire.
244+ -- We don't fire.
245 (Just (True, Nothing), Nothing)
245 (Just (True, Nothing), Nothing)
246 Just b -> -- and the buffer is full:
246 Just b -> -- and the buffer is full:
247− -- * Immediate mode remains off, and the buffer is cleared.
247+ -- Immediate mode remains off, and the buffer is cleared.
248− -- * We fire with the buffered value.
248+ -- We fire with the buffered value.
249 (Just (False, Nothing), Just b)
249 (Just (False, Nothing), Just b)
250 These a _ -> -- If both the input and delayed output event fire simultaneously:
250 These a _ -> -- If both the input and delayed output event fire simultaneously:
251− -- * Immediate mode turns off, and the buffer is empty.
251+ -- Immediate mode turns off, and the buffer is empty.
252− -- * We fire with the input event's value, as it is the most recent we have seen at this moment.
252+ -- We fire with the input event's value, as it is the most recent we have seen at this moment.
253 (Just (False, Nothing), Just a)
253 (Just (False, Nothing), Just a)
254 rec (_, outE) <- mapAccumMaybeDyn f (True, Nothing) $ align e delayed -- We start in immediate mode with an empty buffer.
254 rec (_, outE) <- mapAccumMaybeDyn f (True, Nothing) $ align e delayed -- We start in immediate mode with an empty buffer.
255 delayed <- delay t outE
255 delayed <- delay t outE