diff options
author | Ben Gamari <ben@smart-cactus.org> | 2021-10-07 15:47:24 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2021-10-07 15:55:42 -0400 |
commit | ce61d25afab3db003eba1eb34bc4e365d224c635 (patch) | |
tree | ed2a243a855b7094c8b7220b089b78078dd890e8 /compiler/GHC/Core/RoughMap.hs | |
parent | 128c2c186f6557b63430a9e8f6b9ec1ca19221bb (diff) | |
download | haskell-wip/T19703.tar.gz |
Eliminate mapM_ over eltsRMwip/T19703
Diffstat (limited to 'compiler/GHC/Core/RoughMap.hs')
-rw-r--r-- | compiler/GHC/Core/RoughMap.hs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/GHC/Core/RoughMap.hs b/compiler/GHC/Core/RoughMap.hs index 4e55075e13..46cfe2bf45 100644 --- a/compiler/GHC/Core/RoughMap.hs +++ b/compiler/GHC/Core/RoughMap.hs @@ -22,6 +22,7 @@ module GHC.Core.RoughMap , elemsRM , sizeRM , foldRM + , traverse_RM , unionRM ) where @@ -208,6 +209,9 @@ dropEmpty rm = Just rm elemsRM :: RoughMap a -> [a] elemsRM = foldRM (:) [] +traverse_RM :: Monad m => (a -> m ()) -> RoughMap a -> m () +traverse_RM f = foldRM (\x rest -> f x >> rest) (return ()) + foldRM :: (a -> b -> b) -> b -> RoughMap a -> b foldRM f = go where |