[Git][ghc/ghc][wip/T22717] Accept an orphan declaration (sadly)

Simon Peyton Jones (@simonpj) gitlab at gitlab.haskell.org
Tue Jan 24 12:28:58 UTC 2023



Simon Peyton Jones pushed to branch wip/T22717 at Glasgow Haskell Compiler / GHC


Commits:
379fc5bf by Simon Peyton Jones at 2023-01-24T12:28:53+00:00
Accept an orphan declaration (sadly)

See Note [The Decoupling Abstract Data Hack] in GHC.Driver.Hooks

- - - - -


2 changed files:

- compiler/GHC/Driver/Hooks.hs
- compiler/GHC/HsToCore/Types.hs


Changes:

=====================================
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]


=====================================
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(..),



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/379fc5bf07aaa4fa508659d77f2fab9971961158

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/379fc5bf07aaa4fa508659d77f2fab9971961158
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230124/183a05c7/attachment-0001.html>


More information about the ghc-commits mailing list