diff options
author | Fendor <power.walross@gmail.com> | 2021-07-19 11:42:01 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-07-21 02:46:50 -0400 |
commit | 5b157eb2bea7fc4ad654c83258cf1ab6ad0f85f0 (patch) | |
tree | 7efac4ebf4829083e9bfe3d0882e463841b7a3be /compiler/GHC/Platform | |
parent | 06d1ca856d3374bf8dac952740cfe4cef76a350d (diff) | |
download | haskell-5b157eb2bea7fc4ad654c83258cf1ab6ad0f85f0.tar.gz |
Use Ways API instead of Set specific functions
Diffstat (limited to 'compiler/GHC/Platform')
-rw-r--r-- | compiler/GHC/Platform/Ways.hs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/compiler/GHC/Platform/Ways.hs b/compiler/GHC/Platform/Ways.hs index f9e70b7b92..71337187d8 100644 --- a/compiler/GHC/Platform/Ways.hs +++ b/compiler/GHC/Platform/Ways.hs @@ -24,7 +24,9 @@ module GHC.Platform.Ways ( Way(..) , Ways , hasWay + , hasNotWay , addWay + , removeWay , allowed_combination , wayGeneralFlags , wayUnsetGeneralFlags @@ -72,14 +74,22 @@ data Way type Ways = Set Way --- | Test if a ways is enabled +-- | Test if a way is enabled hasWay :: Ways -> Way -> Bool hasWay ws w = Set.member w ws +-- | Test if a way is not enabled +hasNotWay :: Ways -> Way -> Bool +hasNotWay ws w = Set.notMember w ws + -- | Add a way addWay :: Way -> Ways -> Ways addWay = Set.insert +-- | Remove a way +removeWay :: Way -> Ways -> Ways +removeWay = Set.delete + -- | Check if a combination of ways is allowed allowed_combination :: Ways -> Bool allowed_combination ways = not disallowed |