Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • 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,842
    • Issues 4,842
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 456
    • Merge requests 456
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #11014

Closed
Open
Created Oct 24, 2015 by elaforge@trac-elaforge

re-order GHC type errors for clarity

Here's a typical simple type error from GHC:

Derive/Call/India/Pakhawaj.hs:142:62:
    Couldn't match type ‘Text’ with ‘(a1, Syllable)’
    Expected type: [([(a1, Syllable)], [Sequence Bol])]
      Actual type: [([Syllable], [Sequence Bol])]
    Relevant bindings include
      syllables :: [(a1, Syllable)]
	(bound at Derive/Call/India/Pakhawaj.hs:141:16)
      best_match :: [(a1, Syllable)]
		    -> Maybe (Int, ([(a1, Syllable)], [(a1, Sequence Bol)]))
	(bound at Derive/Call/India/Pakhawaj.hs:141:5)
    In the second argument of ‘mapMaybe’, namely ‘all_bols’
    In the second argument of ‘($)’, namely
      ‘mapMaybe (match_bols syllables) all_bols’

The order of sections is "couldn't match", "expected actual", "relevant bindings", "context" (in the second argument etc.). I think it would be easier to read as "couldn't match", "expected actual", "context", "bindings", and with a * to mark each section:

Derive/Call/India/Pakhawaj.hs:142:62:
  * Couldn't match type ‘Text’ with ‘(a1, Syllable)’
    Expected type: [([(a1, Syllable)], [Sequence Bol])]
      Actual type: [([Syllable], [Sequence Bol])]
  * In the second argument of ‘mapMaybe’, namely ‘all_bols’
    In the second argument of ‘($)’, namely
      ‘mapMaybe (match_bols syllables) all_bols’
  * Relevant bindings include
      syllables :: [(a1, Syllable)]
	(bound at Derive/Call/India/Pakhawaj.hs:141:16)
      best_match :: [(a1, Syllable)]
		    -> Maybe (Int, ([(a1, Syllable)], [(a1, Sequence Bol)]))
	(bound at Derive/Call/India/Pakhawaj.hs:141:5)

I'm sure there are plenty of other sections that don't show up in this simple example, in any case they should go from most to least critical and be marked off with a *.

Trac metadata
Trac field Value
Version 7.11
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