Skip to content

GitLab

  • Menu
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 4,934
    • Issues 4,934
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 455
    • Merge requests 455
  • 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 Compiler
  • GHCGHC
  • Issues
  • #7222
Closed
Open
Created Sep 06, 2012 by maltem@trac-maltem

The text "Possible fix: add an instance declaration for ..." is redundant and not usually helpful

The current state of affairs: Given a typical type error, for example

"a" + "b"

we get

    No instance for (Num [Char])
      arising from a use of `+'
    Possible fix: add an instance declaration for (Num [Char])
    In the expression: "a" + "b"
    In an equation for `it': it = "a" + "b"

I'm concerned with the third line here:

  1. It is redundant, for it just repeats information from the first line. In my experience, the redundancy sometimes hinders usability, namely, when the types get very long, visually burying the problematic expression.

  2. Furthermore it is often misleading: Everyday type errors stem from incorrect usage of a library, not from missing bits of a library. The line tends to be confusing especially for new users: the only ones who might have profited from the redundancy.

  3. To expand a bit on (1): An imported bit of information in the type error is the fact that the type mismatch lies in the application of (+) to "a". The user gains this information by combination of lines 2 and 4. It is incovenient that line 3 visually seperates those lines.

I propose that the problematic line be simply removed.

Trac metadata
Trac field Value
Version 7.4.2
Type Bug
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