Skip to content

'Decouple Language.Haskell.Syntax.Decls' from 'GHC.Unit.Module.Warnings'

recursion-ninja requested to merge wip/fix-26636 into master

This MR addresses issue #26636 (closed), decoupling the Language.Haskell.Syntax.Decls module from depending on GHC.Unit.Module.Warnings.

The dependency between Language.Haskell.Syntax.Decls and GHC.Unit.Module.Warnings has been inverted, with GHC.Unit.Module.Warnings now importing the core warning types from Language.Haskell.Syntax.Decls.

The following data-types are moved from GHC.Unit.Module.Warnings to Language.Haskell.Syntax.Decls.

  • WarningTxt
  • InWarningCategory
  • WarningCategory

Extension points are defined for each of these data-types via the TTG methodology and their type family instances are defined within GHC.Unit.Module.Warnings.

Orphan type-class instances for these data-types exist as well.

  • GHC.Hs.Instances defines instances of:

    • Data: These are expected to be defined here.
  • GHC.Unit.Module.Warnings defines instances of:

    • Eq: These are unlikely to be moveable to Language.Haskell.Syntax.Decls and will have to stay here.
    • Binary: These show be moved to GHC.Utils.Binary after more TTG work has been complete.
    • Outputable These show be moved to GHC.Utils.Outputable after more TTG work has been complete.
    • Uniqueable These show be moved to GHC.Types.Uniquw after more TTG work has been complete.
Edited by recursion-ninja

Merge request reports

Loading