digit groups

Ketil Malde ketil+haskell at ii.uib.no
Tue Oct 24 03:28:47 EDT 2006

Henning Thielemann <haskell at henning-thielemann.de> writes:

>> 1. allow to use '_' in number literals. its used in Ruby and i found
>> that this makes long number literals much more readable. for example

> Sounds like something that can be solved with an infix operator:

> (~~) :: Integer -> Integer -> Integer
> a ~~ b  =  a*1000 + b

Nice.  Although the ~~ seems a bit intrusive.  Since its use would be
thouroughly optional, perhaps we could adopt an extended (A0-FF)
character for this?  Some candidates:

       257   175   AF     ¯     MACRON
       267   183   B7     ·     MIDDLE DOT
       270   184   B8     ¸     CEDILLA
       260   176   B0     °     DEGREE SIGN

Tempting to use B8 Cedilla, since it looks somewhat like a comma, and
is less useful for other purposes -- but perhaps it would be to easily
confused with a real comma? 

Ideally, one would also require a group of three digits to the right
of such an operator.

If I haven't seen further, it is by standing in the footprints of giants

More information about the Haskell-prime mailing list