
5 Jul
2007
5 Jul
'07
2:49 a.m.
R> Another interesting thing I've discovered is: Prelude>> length [1..1000000] R> 1000000 Prelude>> Data.List.genericLength [1..1000000] R> *** Exception: stack overflow R> Maybe there is something wrong with Integer ? No, there is something wrong with genericLength: Prelude> Data.List.foldl (+) 0 $ map (const 1) [1..1000000] :: Int *** Exception: stack overflow Prelude> Data.List.foldl' (+) 0 $ map (const 1) [1..1000000] :: Integer 1000000