diff options
author | Sebastian Graf <sebastian.graf@kit.edu> | 2019-11-28 11:04:58 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-11-30 02:59:55 -0500 |
commit | 3a96a0b6db6a32457ae2f91bb711c2481c767656 (patch) | |
tree | 13ddfa512f6db6da9e90c0fd3ffda5add1d91990 | |
parent | d1de5c227160f555ea6d5679791388a980910c88 (diff) | |
download | haskell-3a96a0b6db6a32457ae2f91bb711c2481c767656.tar.gz |
Simpler Semigroup instance for InsideLam and InterestingCtxt
This mirrors the definition of `(&&)` and `(||)` now, relieving the
Simplifier of a marginal amount of pressure.
-rw-r--r-- | compiler/basicTypes/BasicTypes.hs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/compiler/basicTypes/BasicTypes.hs b/compiler/basicTypes/BasicTypes.hs index 94e2d2daa8..7513e08f82 100644 --- a/compiler/basicTypes/BasicTypes.hs +++ b/compiler/basicTypes/BasicTypes.hs @@ -936,9 +936,8 @@ data InterestingCxt -- | If there is any 'interesting' identifier occurance, then the -- aggregated occurance info of that identifier is considered interesting. instance Semi.Semigroup InterestingCxt where - IsInteresting <> _ = IsInteresting - _ <> IsInteresting = IsInteresting - _ <> _ = NotInteresting + NotInteresting <> x = x + IsInteresting <> _ = IsInteresting instance Monoid InterestingCxt where mempty = NotInteresting @@ -957,9 +956,8 @@ data InsideLam -- | If any occurance of an identifier is inside a lambda, then the -- occurance info of that identifier marks it as occuring inside a lambda instance Semi.Semigroup InsideLam where - IsInsideLam <> _ = IsInsideLam - _ <> IsInsideLam = IsInsideLam - _ <> _ = NotInsideLam + NotInsideLam <> x = x + IsInsideLam <> _ = IsInsideLam instance Monoid InsideLam where mempty = NotInsideLam |