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,251
    • Issues 5,251
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 576
    • Merge requests 576
  • 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
  • #4940
Closed
Open
Issue created Feb 01, 2011 by batterseapower@trac-batterseapower

Bad error message using poly pat bind with MonoPatBinds

This program:

foo :: a -> a
bar :: a -> a
(foo, bar) = (\x -> x, \y -> y)

main = print $ foo $ bar 1

Is trying to pattern-bind a polymorphic function. The error message is dreadful:

/Users/mbolingbroke/Junk/PolyPatBinds.hs:5:15:
    Couldn't match expected type `t -> t1'
                with actual type `forall a. a -> a'
    The lambda expression `\ x -> x' has one argument one argument,
    but its type `forall a. a -> a' has none
    In the expression: \ x -> x
    In the expression: (\ x -> x, \ y -> y)

The issues are:

  1. It repeats itself: "one argument one argument"
  2. It is patently incorrect: the type forall a. a -> a DOES have one argument in the standard nomenclature
  3. It does not point the user towards the fix (-XNoMonoPatBinds)
Trac metadata
Trac field Value
Version 7.0.1
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (Type checker)
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