diff options
author | Simon Peyton Jones <simon.peytonjones@gmail.com> | 2023-01-24 12:28:53 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2023-01-27 23:54:55 -0500 |
commit | 15750d33f634510920fc5333d346d55b961f4208 (patch) | |
tree | 5c8ed529060ce57b5603e60dcc4d76c579aad9c8 | |
parent | 0f25a13b7a59859d4be8be15af083e1c12ea6bc5 (diff) | |
download | haskell-15750d33f634510920fc5333d346d55b961f4208.tar.gz |
Accept an orphan declaration (sadly)
This accepts the orphan type family instance
type instance DsForeignHook = ...
in GHC.HsToCore.Types.
See Note [The Decoupling Abstract Data Hack] in GHC.Driver.Hooks
-rw-r--r-- | compiler/GHC/Driver/Hooks.hs | 3 | ||||
-rw-r--r-- | compiler/GHC/HsToCore/Types.hs | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/compiler/GHC/Driver/Hooks.hs b/compiler/GHC/Driver/Hooks.hs index a6458d7738..7608890ce7 100644 --- a/compiler/GHC/Driver/Hooks.hs +++ b/compiler/GHC/Driver/Hooks.hs @@ -121,6 +121,9 @@ In doing so, the Hooks module (which is an hs-boot dependency of DynFlags) can be decoupled from its use of the DsM definition in GHC.HsToCore.Types. Since both DsM and the definition of @ForeignsHook@ live in the same module, there is virtually no difference for plugin authors that want to write a foreign hook. + +An awkward consequences is that the `type instance DsForeignsHook`, in +GHC.HsToCore.Types is an orphan instance. -} -- See Note [The Decoupling Abstract Data Hack] diff --git a/compiler/GHC/HsToCore/Types.hs b/compiler/GHC/HsToCore/Types.hs index f1c1f98bc6..d3e7f2ddbd 100644 --- a/compiler/GHC/HsToCore/Types.hs +++ b/compiler/GHC/HsToCore/Types.hs @@ -1,5 +1,10 @@ {-# LANGUAGE TypeFamilies, UndecidableInstances #-} +{-# OPTIONS_GHC -Wno-orphans #-} + -- Don't warn that `type instance DsForeignsHooks = ...` + -- is an orphan; see Note [The Decoupling Abstract Data Hack] + -- in GHC.Driver.Hooks + -- | Various types used during desugaring. module GHC.HsToCore.Types ( DsM, DsLclEnv(..), DsGblEnv(..), |