
29 May
2008
29 May
'08
4:30 a.m.
Hi
Following this line of reasoning: why is 1 syntactic sugar for fromIntegral 1? If 1 has type Integer then the generic value is just a fromIntergal away!
That's a good point the other way --- I suspect, like most things Num, numeric literals were rather grand-fathered in than designed intentionally that way.
fromIntegral is essential if you have two "integer" types, namely Int and Integer. If you are looking for something to blame, then its the premature optimisation that is Int. Int is really just a performance hack around Integer. Of course, we all want the performance of Int, so I'm not saying its a bad thing. But one hack often leads to another. Thanks Neil