Pragma for suppressing 'orphan instance' warnings per instance
Additionally to #2515 (closed) I'd like to suppress orphan instances warnings individually. I do not always like to disable orphan instance warnings globally for a module, since some of the warnings may point to an instance that can actually be moved to a more appropriate module.
Syntax could be
{-# NOWARN orphan #-}
instance C T where
...
or simply
{-# NOWARN #-}
instance C T where
...
(Before GHC-6.12 a general local NOWARN pragma could also help to minimize wrong warnings about unused imported modules. And sometimes I also like to disable 'unused identifier' warning for some top-level functions, that shall be type checked, but not exported, because their API is still not mature.)
Trac metadata
| Trac field | Value |
|---|---|
| Version | 6.12.1 |
| Type | FeatureRequest |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler (Type checker) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | ghc@henning-thielemann.de |
| Operating system | |
| Architecture |