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,247
    • Issues 4,247
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 396
    • Merge Requests 396
  • 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
  • #13321

Closed
Open
Opened Feb 23, 2017 by Edward Z. Yang@ezyangDeveloper

Importing a bundled pattern "infects" all other imports of that pattern

Consider:

{-# LANGUAGE PatternSynonyms #-}
unit p where
    module A0 where
        data G = G Int
    module A1 where
        import A0
        pattern X x = G x
    module A(G(X)) where
        import A0
        import A1
    module B(G) where
        import A
    module C(pattern X) where
        import A
    module D(N.G, pattern N.X) where
        import B
        import C
        import qualified A0 as N
        import qualified A1 as N

When we look at the interface for D, we see that X is bundled with G. This is a little surprising because I explicitly exported the G and X from A0 and A1, where no bundling took place.

I suppose the current semantics might also be alright, but we should explicitly say so. The spec in the wiki is silent in this respect: https://ghc.haskell.org/trac/ghc/wiki/PatternSynonyms/AssociatingSynonyms

Edited Mar 10, 2019 by Edward Z. Yang
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#13321