[ghc-steering-committee] Underscores in numbers proposal
Iavor Diatchki
iavor.diatchki at gmail.com
Wed Nov 1 22:51:46 UTC 2017
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> wrote:
>
> https://github.com/ghc-proposals/ghc-proposals/pull/76#issuecomment-339952996
>
> 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
> 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/20171101/1ec9ea46/attachment.html>
More information about the ghc-steering-committee
mailing list