Skip to content

MagicHash literals can be negative

Summary

The MagicHash section of GHC user's guide states

In general, any Haskell integer lexeme followed by a # is an Int# literal, e.g. -0x3A# as well as 32#.

But the given -0x3A# literal is not a valid Haskell integer lexeme, not without the NegativeLiterals extension. So the sentence is contradictory when read literally.

Proposed improvements or changes

Add a clarification:

MagicHash numeric literals can be negative even in the absence of the NegativeLiterals extension.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information