Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,393
    • Issues 4,393
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 378
    • Merge Requests 378
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #5108

Closed
Open
Opened Apr 12, 2011 by mikhail.vorozhtsov@trac-mikhail.vorozhtsov

Allow unicode sub/superscript symbols in operators

While #4373 (closed) permits

Prelude> let v₁ = 1

the following is rejected

Prelude> let m >>=₁ f = undefined

<interactive>:0:10: lexical error at character '\8321'

Identifiers with non-numeric subscripts are not accepted either:

Prelude> let vₐ = 1

<interactive>:0:6: lexical error at character '\8336'

I wrote a small patch that makes such definitions possible.

  1. A new unicode Alex macro, $subsup, is introduced and added to $idchar, $symchar, and $graphic
  2. A unicode code point is classified as $subsup by alexGetChar iff either of the following holds:

a. The code point is annotated with <sub> or <super> in http://www.unicode.org/Public/UNIDATA/UnicodeData.txt

b. It is the [DOUBLE/TRIPLE/QUADRUPLE] PRIME (U+2032, U+2033, U+2034, U+2057)

Trac metadata
Trac field Value
Version 7.1
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Edited Mar 10, 2019 by thomie
Assignee
Assign to
8.0.1
Milestone
8.0.1 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#5108