Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,396
    • Issues 5,396
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 588
    • Merge requests 588
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #2993
Closed
Open
Issue created Jan 31, 2009 by Olathe@trac-Olathe

Precedence errors are reported for undefined operators

I found a misleading error message.

If I add the import for (<$>), but I forget to save the file

-- other imports
-- import Control.Applicative ((<$>))
main = print $ (+1).(+2) <$> Just 5

I get the error

    precedence parsing error
        cannot mix `(.)' [infixr 9] and `(<$>)' [infixl 9] in the same infix expression

which is rather hard to debug, since it makes it seem that the problem is either with Control.Applicative's precedence definitions or that I've somehow imported (<$>) with a different precedence from somewhere else.

It would be nice if it would report instead that (<$>) wasn't defined yet.

Trac metadata
Trac field Value
Version 6.10.1
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking