Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Haskell has better libraries than CL

Name: Anonymous 2011-05-20 11:14

They're standardized too!

Name: Anonymous 2011-05-20 11:16

Too bad it's DEAD as fuck.

Name: Anonymous 2011-05-20 11:20

Compared to a language that hasn't been updated for at least 15 years?

0/10

Name: Anonymous 2011-05-20 11:35

Yes, and C++ has even more/better libraries. Is C++ better than Haskell? No.

Name: Anonymous 2011-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: Anonymous 2011-05-20 15:59

if only the Haskell libraries were used for anything

Name: Anonymous 2011-05-20 17:14

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.

Name: Anonymous 2011-05-20 17:14

>>6
Indeed. Sad world.

Name: Anonymous 2011-05-20 18:37

>>7
I never knew /prog/ was an abbreviation for BULLSHIT

Name: Anonymous 2011-05-20 21:38

>>9
Because it's not. It's ``ABSTRACT BULLSHITE'', that you will never comprehend.

Name: Anonymous 2011-05-21 17:12

Lisp

yoba N -> keep {N->all N%?!=0 [2..N/2]} [1..N] | sum


Haskell

import Control.Monad
import Control.Monad.ST
 
import Data.Array.ST
 
import Data.STRef
 
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
 
                        readSTRef sum
 
 
main = print $ yoba 1000000

Don't change these.
Name: Email:
Entire Thread Thread List