Skip to content

ADOPT pragma for silencing orphan instances warnings per instance

Currently GHC only allows enabling and disabling the warnings about orphan instances on a module level. I’d like to have an ADOPT pragma that allows disabling the warning for specific instance:

instance {-# ADOPT #-} C Int

Apart from disabling the warning about orphan instances for this specific instance, this pragma should have no effect.

I already hacked together a prototype and I’m willing to clean that up and submit a diff if other people like this.

This does change the surface language but disabling a warning seem too small of an effect for the ghc proposals process (I’m happy to make a proposal if you disagree).

Trac metadata
Trac field Value
Version 8.3
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information