iavor.diatchki at gmail.com
Wed Oct 25 20:51:00 EDT 2006
while people are discussing different notations for literals, I
thought I should mention that in my work I have found it useful to
write literals ending in K (kilo), M (mega) or G (giga) for large
numbers. For example, I can write 4K for (4 * 2^10), or 8M for (8 *
2^20) or 2G for (2 * 2^30). It is simple to implement because it only
requires a modification to the lexer. It is not really necessary
because we can achieve the same by defining:
kb,mg,gb :: Num a => a
kb = 1024
mb = 1024 * kb
gb = 1024 * mb
and now we can write (4 * kb) instead for 4096. I still think that
the literal notation
is nicer though.
On 10/25/06, John Meacham <john at repetae.net> wrote:
> just for fun, I have implemented this for jhc.
> you can now write numbers like 10_000_000 if you choose.
> I have not decided whether I like the feature or not. but what the heck.
> John Meacham - ⑆repetae.net⑆john⑈
> Haskell-prime mailing list
> Haskell-prime at haskell.org
More information about the Haskell-prime