@@ -88,7 +88,6 @@ module Reflex.Class
8888 , gate
8989 -- ** Combining 'Dynamic's
9090 , distributeDMapOverDynPure
91− , distributeDMapOverDynPureG
9291 , distributeListOverDyn
9392 , distributeListOverDynWith
9493 , zipDyn
@@ -1110,21 +1109,12 @@ instance (Reflex t, Monoid a) => Monoid (Dynamic t a) where
11101109-- 'Dynamic' 'DMap'. Its implementation is more efficient than doing the same
11111110-- through the use of multiple uses of 'zipDynWith' or 'Applicative' operators.
11121111distributeDMapOverDynPure :: forall t k. (Reflex t, GCompare k) => DMap k (Dynamic t) -> Dynamic t (DMap k Identity)
1113−distributeDMapOverDynPure = distributeDMapOverDynPureG coerceDynamic
1114−
1115−-- | This function converts a 'DMap' whose elements are 'Dynamic's into a
1116−-- 'Dynamic' 'DMap'. Its implementation is more efficient than doing the same
1117−-- through the use of multiple uses of 'zipDynWith' or 'Applicative' operators.
1118−distributeDMapOverDynPureG
1119− :: forall t k q v. (Reflex t, GCompare k)
1120− => (forall a. q a -> Dynamic t (v a))
1121− -> DMap k q -> Dynamic t (DMap k v)
1122−distributeDMapOverDynPureG nt dm = case DMap.toList dm of
1112+distributeDMapOverDynPure dm = case DMap.toList dm of
11231113 [] -> constDyn DMap.empty
1124− [k :=> v] -> DMap.singleton k <$> nt v
1114+ [k :=> v] -> fmap (DMap.singleton k . Identity) v
11251115 _ ->
1126− let getInitial = DMap.traverseWithKey (\_ -> sample . current . nt) dm
1127− edmPre = mergeG getCompose $ DMap.map (Compose . updated . nt) dm
1116+ let getInitial = DMap.traverseWithKey (\_ -> fmap Identity . sample . current) dm
1117+ edmPre = merge $ DMap.map updated dm
11281118 result = unsafeBuildDynamic getInitial $ flip pushAlways edmPre $ \news -> do
11291119 olds <- sample $ current result
11301120 return $ DMap.unionWithKey (\_ _ new -> new) olds news