[ghc-steering-committee] #344: Negative Literals Improved, rec: accept

Iavor Diatchki iavor.diatchki at gmail.com
Wed Jul 15 16:37:19 UTC 2020


Hello,

I understand the problem, but let me make sure I understand the solution,
as the proposal is rather terse and refers to the other proposal, that
introduces the exotic lexing scheme.

So am I right in understanding that `f-1` will lex as `f - 1`, but `f -1`
will lext as `f (-1)`?   The reason this would work like that is because
the "white space" token before the `-` is not "closing" and so we know to
parse a negative literal.

Just as a note, I never quite understood how we plan to implement #229---is
it supposed to be done through state in the lexer, or do we have a simple
lexer that keeps all tokens, including white space, and then write a
post-processing function to glue and rejigger tokens?

-Iavor




On Wed, Jul 15, 2020 at 9:05 AM Spiwack, Arnaud <arnaud.spiwack at tweag.io>
wrote:

> I've got no strong opinion. But it does sound reasonable to me.
>
> Maybe this should also be a signal to deprecate NegativeLiterals in favour
> of LexicalNegation.
>
> On Wed, Jul 15, 2020 at 11:16 AM Alejandro Serrano Mena <trupill at gmail.com>
> wrote:
>
>> +1
>>
>> This has traditionally been a pain point for Haskell newcomers, so any
>> fix is welcome.
>>
>> El El mié, 15 jul 2020 a las 11:07, Richard Eisenberg <rae at richarde.dev>
>> escribió:
>>
>>>
>>> On Jul 15, 2020, at 8:58 AM, Joachim Breitner <mail at joachim-breitner.de>
>>> wrote:
>>>
>>> I suggest we accept that proposal.
>>>
>>>
>>> +1
>>>
>>> Yes, let's accept -- and if we act quickly, it can be so for 8.12.
>>>
>>> Thanks,
>>> Richard
>>> _______________________________________________
>>> ghc-steering-committee mailing list
>>> ghc-steering-committee at haskell.org
>>> https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee
>>>
>> _______________________________________________
>> ghc-steering-committee mailing list
>> ghc-steering-committee at haskell.org
>> https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee
>>
> _______________________________________________
> ghc-steering-committee mailing list
> ghc-steering-committee at haskell.org
> https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-steering-committee/attachments/20200715/34790a83/attachment.html>


More information about the ghc-steering-committee mailing list