Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,312
    • Issues 4,312
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 385
    • Merge Requests 385
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #17167

Closed
Open
Opened Sep 08, 2019 by Adam Gundry@adamgundryDeveloper

Role annotations on classes require module-wide IncoherentInstances

Per #8773 (closed), specifying a non-nominal role for a class parameter requires IncoherentInstances:

{-# LANGUAGE RoleAnnotations #-}
{-# LANGUAGE IncoherentInstances #-}

class C c
type role C phantom

For instances, the IncoherentInstances module-wide LANGUAGE pragma has been deprecated in favour of per-instance {-# INCOHERENT #-} pragmas. However, there doesn't appear to be an equivalent for type role on classes. This is awkward because I do not want the instances of C to be marked as incoherent, and hence they cannot be defined in the same module as C.

I think it would make sense to be able to use {-# INCOHERENT #-} after type role, so that it would be accepted without module-wide IncoherentInstances.

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#17167