[ghc-steering-committee] Underscores in numbers proposal

Simon Peyton Jones simonpj at microsoft.com
Thu Nov 2 13:17:02 UTC 2017


I have not dug into the details, but the general direction of this proposal looks fine to me.

Simion

From: ghc-steering-committee [mailto:ghc-steering-committee-bounces at haskell.org] On Behalf Of Iavor Diatchki
Sent: 01 November 2017 22:52
To: Christopher Allen <cma at bitemyapp.com>
Cc: ghc-steering-committee at haskell.org; Joachim Breitner <mail at joachim-breitner.de>
Subject: Re: [ghc-steering-committee] Underscores in numbers proposal

I am fine with this.  Related to our recent discussion: we should probably require that this be protected by a language extension, like all other literal notations.  Perhaps `UnderscoreLiterals`?

-Iavor

PS:  technically, this is not backward compatible :-)  Here is an example:

    instance Num b => Num (a -> b) where
      fromInteger = const . fromInteger

    test :: Integer
    test = 1_1
      where _1 = 2

Currently this evaluates to 1, but with the extension it will evaluate to 11.  I don't think that any real code would be affected by this, I just had a bit of fun writing it.





On Wed, Nov 1, 2017 at 2:33 PM Christopher Allen <cma at bitemyapp.com<mailto:cma at bitemyapp.com>> wrote:
https://github.com/ghc-proposals/ghc-proposals/pull/76#issuecomment-339952996<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fghc-proposals%2Fghc-proposals%2Fpull%2F76%23issuecomment-339952996&data=02%7C01%7Csimonpj%40microsoft.com%7Cd576f1b858a74aa4072e08d5217b4867%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636451735748183647&sdata=WqWuPZ4czfYVVWP6Q%2B0%2BRnMF0j1MSdgJZS4VvY7%2FzYQ%3D&reserved=0>

This appears to have near universal approval. It's certainly a feature
I've been grateful for when writing Rust code. I wasn't able to find a
thread about this proposal in my email archives, so I apologize if
this was redundant.

Could this be moved to a decision soon?

Thank you,
Chris Allen
_______________________________________________
ghc-steering-committee mailing list
ghc-steering-committee at haskell.org<mailto: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/20171102/8930e578/attachment-0001.html>


More information about the ghc-steering-committee mailing list