@@ -944,10 +944,6 @@ unsafeMapIncremental f g a = unsafeBuildIncremental (fmap f $ sample $ currentIn
944944mergeMap :: (Reflex t, Ord k) => Map k (Event t a) -> Event t (Map k a)
945945mergeMap = fmap dmapToMap . merge . mapWithFunctorToDMap
946946
947−-- | Like 'mergeMap' but for 'IntMap'.
948−mergeIntMap :: Reflex t => IntMap (Event t a) -> Event t (IntMap a)
949−mergeIntMap = fmap dmapToIntMap . merge . intMapWithFunctorToDMap
950−
951947-- | Create a merge whose parents can change over time
952948mergeMapIncremental :: (Reflex t, Ord k) => Incremental t (PatchMap k (Event t a)) -> Event t (Map k a)
953949mergeMapIncremental = fmap dmapToMap . mergeIncremental . unsafeMapIncremental mapWithFunctorToDMap (const2PatchDMapWith id)
@@ -1032,19 +1028,19 @@ switchHoldPromptOnly e0 e' = do
10321028
10331029-- | When the given outer event fires, condense the inner events into the contained patch. Non-firing inner events will be replaced with deletions.
10341030coincidencePatchMap :: (Reflex t, Ord k) => Event t (PatchMap k (Event t v)) -> Event t (PatchMap k v)
1035−coincidencePatchMap e = fmapCheap PatchMap $ coincidence $ ffor e $ \(PatchMap m) -> mergeMap $ ffor m $ \case
1031+coincidencePatchMap e = fmapCheap PatchMap $ coincidence $ fforCheap e $ \(PatchMap m) -> mergeMap $ ffor m $ \case
10361032 Nothing -> fmapCheap (const Nothing) e
10371033 Just ev -> leftmost [fmapCheap Just ev, fmapCheap (const Nothing) e]
10381034
10391035-- | See 'coincidencePatchMap'
10401036coincidencePatchIntMap :: Reflex t => Event t (PatchIntMap (Event t v)) -> Event t (PatchIntMap v)
1041−coincidencePatchIntMap e = fmapCheap PatchIntMap $ coincidence $ ffor e $ \(PatchIntMap m) -> mergeIntMap $ ffor m $ \case
1037+coincidencePatchIntMap e = fmapCheap PatchIntMap $ coincidence $ fforCheap e $ \(PatchIntMap m) -> mergeIntMap $ ffor m $ \case
10421038 Nothing -> fmapCheap (const Nothing) e
10431039 Just ev -> leftmost [fmapCheap Just ev, fmapCheap (const Nothing) e]
10441040
10451041-- | See 'coincidencePatchMap'
10461042coincidencePatchMapWithMove :: (Reflex t, Ord k) => Event t (PatchMapWithMove k (Event t v)) -> Event t (PatchMapWithMove k v)
1047−coincidencePatchMapWithMove e = fmapCheap unsafePatchMapWithMove $ coincidence $ ffor e $ \p -> mergeMap $ ffor (unPatchMapWithMove p) $ \ni -> case PatchMapWithMove._nodeInfo_from ni of
1043+coincidencePatchMapWithMove e = fmapCheap unsafePatchMapWithMove $ coincidence $ fforCheap e $ \p -> mergeMap $ ffor (unPatchMapWithMove p) $ \ni -> case PatchMapWithMove._nodeInfo_from ni of
10481044 PatchMapWithMove.From_Delete -> fforCheap e $ \_ ->
10491045 ni { PatchMapWithMove._nodeInfo_from = PatchMapWithMove.From_Delete }
10501046 PatchMapWithMove.From_Move k -> fforCheap e $ \_ ->
@@ -1304,7 +1300,7 @@ accumMaybeMDyn
13041300 -> Event t b
13051301 -> m (Dynamic t a)
13061302accumMaybeMDyn f z e = do
1307− rec let e' = flip push e $ \o -> do
1303+ rec let e' = flip pushCheap e $ \o -> do
13081304 v <- sample $ current d'
13091305 f v o
13101306 d' <- holdDyn z e'
@@ -1360,8 +1356,8 @@ mapAccumMaybeMDyn f z e = do
13601356 return $ case result of
13611357 (Nothing, Nothing) -> Nothing
13621358 _ -> Just result
1363− d' <- holdDyn z $ mapMaybe fst e'
1364− return (d', mapMaybe snd e')
1359+ d' <- holdDyn z $ fmapMaybeCheap fst e'
1360+ return (d', fmapMaybeCheap snd e')
13651361
13661362-- | Accumulate a 'Behavior' by folding occurrences of an 'Event'
13671363-- with the provided function.
@@ -1399,7 +1395,7 @@ accumMaybeB f = accumMaybeMB $ \v o -> return $ f v o
13991395{-# INLINE accumMaybeMB #-}
14001396accumMaybeMB :: (Reflex t, MonadHold t m, MonadFix m) => (a -> b -> PushM t (Maybe a)) -> a -> Event t b -> m (Behavior t a)
14011397accumMaybeMB f z e = do
1402− rec let e' = flip push e $ \o -> do
1398+ rec let e' = flip pushCheap e $ \o -> do
14031399 v <- sample d'
14041400 f v o
14051401 d' <- hold z e'
@@ -1449,8 +1445,8 @@ mapAccumMaybeMB f z e = do
14491445 return $ case result of
14501446 (Nothing, Nothing) -> Nothing
14511447 _ -> Just result
1452− d' <- hold z $ mapMaybe fst e'
1453− return (d', mapMaybe snd e')
1448+ d' <- hold z $ fmapMaybeCheap fst e'
1449+ return (d', fmapMaybeCheap snd e')
14541450
14551451-- | Accumulate occurrences of an 'Event', producing an output occurrence each
14561452-- time. Discard the underlying 'Accumulator'.
@@ -1676,7 +1672,14 @@ mergeWithFoldCheap' f es =
16761672-- | See 'switchHoldPromptly'
16771673switchPromptly :: (Reflex t, MonadHold t m) => Event t a -> Event t (Event t a) -> m (Event t a)
16781674switchPromptly = switchHoldPromptly
1675+
16791676{-# DEPRECATED switchPromptOnly "Use 'switchHoldPromptOnly' instead. The 'switchHold*' naming convention was chosen because those functions are more closely related to each other than they are to 'switch'. " #-}
16801677-- | See 'switchHoldPromptOnly'
16811678switchPromptOnly :: (Reflex t, MonadHold t m) => Event t a -> Event t (Event t a) -> m (Event t a)
16821679switchPromptOnly = switchHoldPromptOnly
1680+
1681+{-# DEPRECATED mergeIntMap "Use 'mergeInt' instead" #-}
1682+-- | Like 'mergeMap' but for 'IntMap'.
1683+mergeIntMap :: Reflex t => IntMap (Event t a) -> Event t (IntMap a)
1684+mergeIntMap = mergeInt
1685+