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,393
    • Issues 4,393
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 374
    • Merge Requests 374
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #11970

Closed
Open
Opened Apr 22, 2016 by Simon Peyton Jones@simonpjDeveloper

Simplify Parent for patten synonyms

This commit

commit 96621b1b4979f449e873513e9de8d806257c9493
    Associate pattern synonyms with types in module exports

added PatternSynonym to RdrName.Parent. That's a pretty heavy hammer. It forces us to add IsPatSyn to AvailInfo, including binary serialisation etc.

And I think it's needed in precisely one place, namely RnNames.findPatSyns. Right?

The caller of findPatSyns and the associated lookupChildren is jolly obscure and I don't fully understand it. I **think** the issue is this:

  • I want to allow an export item T( K ), where K is a pattern synonym, even though it's not really (yet) associated with T.

I think the goal of this code was to reject the K if it's a data constructor.

But we also have a **further** check in tcExports to check that K has the right type.

Surely it'd be better to nuke this PatternSynonym and IsPatSyn stuff? Just useisDataOcc in the export lookup part. Then the tcExport check will object if you write an export item like Either( Just ).

Fewer moving parts!

Matthew, does this make sense? Might you look at it?

Trac metadata
Trac field Value
Version 7.10.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Edited Mar 10, 2019 by Simon Peyton Jones
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#11970