[Haskell-cafe] memory issues

Bulat Ziganshin bulat.ziganshin at gmail.com
Fri Feb 27 18:37:03 EST 2009


Hello Daniel,

Saturday, February 28, 2009, 2:21:31 AM, you wrote:

>>   printf "%s" $ unlines $ map (show) (sort $! blocks content)

> Bad!
> Use
>         mapM_ print $ sort $ blocks content

are you sure? print may waste a lot of time, locking stdout for every
line printed

$! is really useless here - it will require to compute only *head* of
list before calling sort which is absolutely useless :)


-- 
Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com



More information about the Haskell-Cafe mailing list