summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Peyton Jones <simon.peytonjones@gmail.com>2023-01-24 12:28:53 +0000
committersheaf <sam.derbyshire@gmail.com>2023-01-27 12:22:20 +0100
commit62446761df0b69ec46bced3d67f7ffc5b1c852e7 (patch)
tree5f6eb4eb24925d579e9d583031382214285680b2
parent8386b16d0d8651849ef9928bd4c00c378203d93f (diff)
downloadhaskell-wip/T22717.tar.gz
Accept an orphan declaration (sadly)wip/T22717
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.hs3
-rw-r--r--compiler/GHC/HsToCore/Types.hs5
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(..),