on develop help sign in
Add deprecated to mapPartitionEithers
commitb146245687045c1f1730ab911b65c373484467f6 authorDivam <dfordivam@gmail.com> dateWed 23 Jan 2019, 09:10 (8 years ago) parent4f96b76
1 file changed+2−1
src/Data/Map/Misc.hs+2−1
src/Data/Map/Misc.hs+2−1
@@ -46,12 +46,13 @@ diffMap olds news = flip Map.mapMaybe (align olds news) $ \case
4646-- See also 'Reflex.Patch.Map' and 'Reflex.Patch.MapWithMove'.
4747applyMap :: Ord k => Map k (Maybe v) -> Map k v -> Map k v
4848applyMap patch old = insertions `Map.union` (old `Map.difference` deletions)
49− where (deletions, insertions) = mapPartitionEithers $ maybeToEither <$> patch
49+ where (deletions, insertions) = Map.mapEither id $ maybeToEither <$> patch
5050 maybeToEither = \case
5151 Nothing -> Left ()
5252 Just r -> Right r
5353
5454-- |Split a @'Map' k (Either a b)@ into @Map k a@ and @Map k b@, equivalent to @'Map.mapEither' id@
55+{-# DEPRECATED mapPartitionEithers "Use 'mapEither' instead" #-}
5556mapPartitionEithers :: Map k (Either a b) -> (Map k a, Map k b)
5657mapPartitionEithers = Map.mapEither id
5758