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,262
    • Issues 4,262
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 419
    • Merge Requests 419
  • 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
  • #837

Closed
Open
Opened Jul 28, 2006 by p.tanski@gmail.com@trac-p.tanski

Infer fully qualified names to overcome namespace clashes

If you could interpret Section 5.5.2 of the last published Haskell Report (1998) as meaning: "[i]t is not an error for there to exist names [such as A.f or f] that cannot be ... resolved [by the implementation] ..." Then it would be exceptionally handy for GHC to be able to infer what any human being can infer from most name usage in a function. For example:

import Data.Map import Data.List

runThroughMap :: (Ord k) => Map k a -> Map k b runThroughMap m = map f m

runThroughList :: [a] -> [b] runThroughList l = map g l

GHC will produce an error that this "map" is an ambiguous reference and provides a nice error message containing the fully qualified names. If you accept a permissive interpretation of Section 5.5.2 of the '98 Report, GHC could infer from context that map in runThroughMap is being used on a Map and therefore should be fully qualifiable and unambiguous; similarly for map used in runThroughList.

Of course, if you disagree with this interpretation for whatever reason--many reasons are practical--feel free to delete this feature request...

W.B.R. -Peter T.

Trac metadata
Trac field Value
Version 6.4.2
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system Unknown
Architecture Unknown
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#837