Opened 7 years ago

Last modified 15 months ago

#1318 new feature request

add warning for prefix negate operator and flag to replace it with negative numeric literals

Reported by: Isaac Dupree Owned by:
Priority: normal Milestone:
Component: Compiler (Parser) Version: 6.6.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

This is tracking a few things relating to the notion that Haskell's single prefix operator, "-", should not exist and "-1" should parse as a single token anyway. See http://thread.gmane.org/gmane.comp.lang.haskell.glasgow.user/11954

If there is a LANGUAGE option for this, what should it be called; and what should the ghc flags be called? Should turning off prefix negation and turning on negative numeric literals be separately controllable? This sort of question (exactly what should be implemented) is probably half the difficulty here.

Change History (4)

comment:1 Changed 7 years ago by Isaac Dupree

  • Milestone changed from 6.8 to _|_
  • Owner Isaac Dupree deleted

Work here is pending a specific proposal of what to implement, that there is consensus on. I'm not sure exactly what I want, and (given how my summer is turning out) I'm not really feeling up to making proposals for that. Anyone who wants this pursued further should do so (at which point I might implement that).

Well, there is one thing -fwarn-all-unary-minus that seems straightforward enough, if anyone else hates their semantics as well as syntax that much?

comment:2 Changed 6 years ago by simonmar

  • Architecture changed from Unknown to Unknown/Multiple

comment:3 Changed 6 years ago by simonmar

  • Operating System changed from Unknown to Unknown/Multiple

comment:4 Changed 15 months ago by morabbin

  • Type of failure set to None/Unknown

Bump; still of interest?

Note: See TracTickets for help on using tickets.