diff options
| author | Zejun Wu <watashi@fb.com> | 2021-08-21 14:40:33 -0700 |
|---|---|---|
| committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-10-12 01:39:53 -0400 |
| commit | 9f9d62807c620b65865705bacf773cc8f0bd02d9 (patch) | |
| tree | a841de89aaeb37fcd76e275af6ed2a25391d8938 | |
| parent | 245ab1662edd91a82c17de110c79450fec3f7b82 (diff) | |
| download | haskell-9f9d62807c620b65865705bacf773cc8f0bd02d9.tar.gz | |
Derive Eq instance for the HieTypeFix type
We have `instance Eq a => Eq (HieType a)` already. This instance can be
handy when we want to impement a function to find all
`fromIntegral :: a -> a` using
`case ty of { Roll (HFunTy _ a b) -> a == b; _ -> False }`.
| -rw-r--r-- | compiler/GHC/Iface/Ext/Types.hs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/GHC/Iface/Ext/Types.hs b/compiler/GHC/Iface/Ext/Types.hs index 73a4012f23..a0a8a41ece 100644 --- a/compiler/GHC/Iface/Ext/Types.hs +++ b/compiler/GHC/Iface/Ext/Types.hs @@ -155,6 +155,7 @@ type HieTypeFlat = HieType TypeIndex -- | Roughly isomorphic to the original core 'Type'. newtype HieTypeFix = Roll (HieType (HieTypeFix)) + deriving Eq instance Binary (HieType TypeIndex) where put_ bh (HTyVarTy n) = do |
