Yes, and C++ has even more/better libraries. Is C++ better than Haskell? No.
Name:
Anonymous2011-05-20 11:47
I'd disagree that the C++ libs are better, however that isn't in the scope of this post. Haskell vs. Sepples library-wise doesn't compare to Haskell vs. CL library-wise. CL's libs are just a non-standard pile of shit.
Name:
Anonymous2011-05-20 15:59
if only the Haskell libraries were used for anything
What does ``non-standard pile of shit'' mean? A lot of them have standards behind them or proper documentation. There are some bad libs, but there are enough good ones. I'm mostly fine with CL's library situation. I almost always find what I need and the code that I write is portable.
yoba maxPr = runST $ do sum <- newSTRef 0
items <- newArray (2, maxPr) True :: ST s (STUArray s Integer Bool)
let limit = truncate $ sqrt $ fromIntegral maxPr
let incSum = (modifySTRef sum) . (+)
[2.. limit] `forM_` \index -> readArray items index
>>= when `flip` do forM_ [index * index, index * index + index .. maxPr] $ writeArray items `flip` False
[2.. maxPr] `forM_` \index -> readArray items index
>>= when `flip` do incSum index