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,255
    • Issues 5,255
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 562
    • Merge requests 562
  • 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
  • #2507
Closed
Open
Issue created Aug 09, 2008 by Isaac Dupree@trac-Isaac_Dupree

quotation characters in error messages

(wasn't there a ticket for this already?)

Currently identifiers etc. are quoted like this, with the "grave accent" and symmetric single-quote characters:

    Ambiguous type variable `m' in the constraint:
      `Monad m' arising from a use of `>>=' at gw.hs:6:47-71

This is not only an incorrect use of the "grave accent", but can be confusing when an identifier-name contains the prime symbol which is the same as the character used here to end the quote.

What should we do? Well, I just noticed that gcc-4.2.3 uses the Unicode begin-single-quote and end-single-quote characters for the purpose (and it actually looks quite nice on my terminal). If GCC was willing to do it, perhaps we should be too! To be precise, it uses them in my default locale, "en_US.UTF-8", which must have been the Ubuntu default that I didn't even remember I had. With env LANG=C, GCC emits ASCII single-quotes for both the begin and the end.

> cat errory.c 
syntax error
> gcc errory.c 
errory.c:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘error’
> env LANG=C gcc errory.c 
errory.c:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'error'

I propose copying GCC's behavior (which might involve first looking into exactly what its behavior is in the general case).

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