
27 Apr
2014
27 Apr
'14
6:18 p.m.
On Apr 27, 2014 1:10 PM, "Niklas Hambüchen"
On 27/04/14 03:28, John Lato wrote:
No, I mean this:
V.forM_ (V.enumFromN 1 n)
Hey John,
unfortunately that's not fast, and it eats all the RAMs.
Here comes the sad comparison of looping in Haskell:
- loop (maxBound :: Word32) 3 seconds, constant space
- forM_ [0..maxBound :: Word32] 36 seconds, constant space
- V.forM_ (V.enumFromTo 0 (maxBound :: Word32)) 37 seconds, constant space
- V.forM_ (V.enumFromN 0 (fromIntegral (maxBound :: Word32))) linear space -> crashes
All loops execute `return ()`.
Hmm. Are you using regular vectors or unboxed? Also what sort of crash? Is it a stack space overflow or are you on a 32-bit platform?