Packed String parameters

To read a file using a packed string, I need to use this function, right? hGetPS :: Handle -> Int -> IO PackedString What's the Int? Do you have to specify the length in advance? I don't know how packed strings are implemented, and I'm having trouble finding much documentation. I'm trying to speed up this horribly slow thing: dot :: [Double] -> [Double] -> Double dot x y = sum $ zipWith (*) x y main = getContents >>= sequence_ . map (print . dot weights . map read . words) . lines The idea is to take a dot product of each line of a file with a fixed vector of weights, and send the result to stdout. I thought PackedString's might help, but I'm not sure what to do with that parameter. The input file is over 1 million lines long. Any ideas? Thanks, Chad Scherrer Computational Mathematics Group Pacific Northwest National Laboratory "Time flies like an arrow; fruit flies like a banana." -- Groucho Marx

Hello Chad, Thursday, January 19, 2006, 1:09:38 AM, you wrote: SC> parameter. The input file is over 1 million lines long. Any ideas? see at the BlockIO and FastIO libraries http://cryp.to/blockio/blockio-2004-10-10.tar.gz http://www.isi.edu/~hdaume/haskell/FastIO.tar.gz -- Best regards, Bulat mailto:bulatz@HotPOP.com
participants (2)
-
Bulat Ziganshin
-
Scherrer, Chad