diff options
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 |