Skip to content

Implement Underscores in Numeric Literals Proposal (NumericUnderscores extension)

Implement Underscores in Numeric Literals Proposal.

GHC supports various numeric literals such as decimal, octal, hexadecimal, binary, and floating point numbers. However, large numeric literals are hard to read. This proposal improves the readability, quality, expressiveness of numeric literals.

This proposal allows underscores to numeric literals when the NumericUnderscores language extension is enabled. Underscores (_) in numeric literals are simply ignored.

The specification of the feature is available here:\\ ​https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0009-numeric-underscores.rst

For a discussion:\\ https://github.com/ghc-proposals/ghc-proposals/pull/76

Trac metadata
Trac field Value
Version 8.2.1
Type Task
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