diff options
author | Sebastian Graf <sebastian.graf@kit.edu> | 2019-11-28 11:04:58 +0100 |
---|---|---|
committer | Sebastian Graf <sebastian.graf@kit.edu> | 2019-11-29 10:41:25 +0100 |
commit | b08021108906a57cfa73bede97096735ca73eb98 (patch) | |
tree | 2ee52e94432d769f38db6398965c2d5d1d6743e9 | |
parent | 6c59cc71dc20f26d5a6650b16a82faeae72f2065 (diff) | |
download | haskell-wip/improve-T12150.tar.gz |
Simpler Semigroup instance for InsideLam and InterestingCtxtwip/improve-T12150
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 |