diff options
author | Richard Eisenberg <rae@richarde.dev> | 2022-03-29 21:10:16 +0000 |
---|---|---|
committer | Andreas Klebinger <klebinger.andreas@gmx.at> | 2022-04-21 13:33:31 +0000 |
commit | b70c6e8a5c038c8129d8211bd3b04d9f150319b1 (patch) | |
tree | 935ba1f1d463f9590626ed156c52b74091f09887 | |
parent | 0c02c9199c26bebde17cd0afd378802c6d622a88 (diff) | |
download | haskell-wip/foldable-uniqdset.tar.gz |
Add a Foldable UniqDSet instancewip/foldable-uniqdset
This is not used yet, but it will be in another patch,
and this instance seems generally useful.
-rw-r--r-- | compiler/GHC/Types/Unique/DSet.hs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/GHC/Types/Unique/DSet.hs b/compiler/GHC/Types/Unique/DSet.hs index d4d555f83b..d1602e2c6e 100644 --- a/compiler/GHC/Types/Unique/DSet.hs +++ b/compiler/GHC/Types/Unique/DSet.hs @@ -53,6 +53,9 @@ import Data.Data newtype UniqDSet a = UniqDSet {getUniqDSet' :: UniqDFM a a} deriving (Data) +instance Foldable UniqDSet where + foldr f z = foldr f z . uniqDSetToList + emptyUniqDSet :: UniqDSet a emptyUniqDSet = UniqDSet emptyUDFM |