{-# OPTIONS_GHC -fno-warn-orphans #-}

2016-09-16

The correct pragma and flag for silencing warnings about orphan instances is the following:

When googling something like "Haskell no warn orphan" or "Haskell don't warn about orphan instances flag", many incorrect or out-of-date suggestions come up:

Once again, the only valid way to write this is the following:

NOTE: In general, you should heed warnings about orphan instances. However, sometimes it makes sense to have orphan instances, especially when both the datatype and instance are declared in (separate) Internal modules. To any user of the package, it will appear that the instances are not orphans (as long as they don't go looking in the Internal modules).

tags: haskell