X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Futils%2FFiniteMap.lhs;h=3acadf137c24e0ace151450c8368a25edeb4c91a;hp=ca918110e31c579f28e1d894762954d20bdcd8a4;hb=92267aa26adb1ab5a6d8004a80fdf6aa06ea4e44;hpb=861e1d55126391785e93493080d3c7516812675e diff --git a/compiler/utils/FiniteMap.lhs b/compiler/utils/FiniteMap.lhs index ca91811..3acadf1 100644 --- a/compiler/utils/FiniteMap.lhs +++ b/compiler/utils/FiniteMap.lhs @@ -4,7 +4,7 @@ module FiniteMap ( insertList, insertListWith, deleteList, - foldRightWithKey + foldRight, foldRightWithKey ) where import Data.Map (Map) @@ -23,6 +23,8 @@ insertListWith f xs m0 = foldl (\m (k, v) -> Map.insertWith f k v m) m0 xs deleteList :: Ord key => [key] -> Map key elt -> Map key elt deleteList ks m = foldl (flip Map.delete) m ks +foldRight :: (elt -> a -> a) -> a -> Map key elt -> a +foldRight = Map.fold foldRightWithKey :: (key -> elt -> a -> a) -> a -> Map key elt -> a #if (MIN_VERSION_containers(0,4,0)) foldRightWithKey = Map.foldrWithKey