[Haskell-cafe] newbie optimization question

Isaac Dupree isaacdupree at charter.net
Sun Oct 28 12:55:18 EDT 2007


Prabhakar Ragde wrote:
>> You could try giving divisors type signature:
>> divisors :: Int -> [Int]
> 
> Thank you. That brings the time down to 0.5 seconds. I'm glad it was 
> something as simple as that. --PR

I assume GHC was smart enough to do inlining and such in this case, so 
the difference is that it defaulted to Integer, whose operations are 
somewhat slower.

Isaac


More information about the Haskell-Cafe mailing list