|
PackedString.hGetPS produces index exception: msg#00034lang.haskell.glasgow.bugs
Why does the attached function psTest, for ghc5.04.3 on Linux, produce the error: *** Exception: Ix{Int}.index: Index (30000) out of range ((0,29999)) module PS where import IO import Data.PackedString psTest = do f <- openFile "psTest" WriteMode let s1 = "abc" s2 = take 30000 (cycle "k") hPutPS f (packString s1) hPutPS f (packString s2) hClose f g <- openFile "psTest" ReadMode ch1 <- hGetChar g ch2 <- hGetChar g ch3 <- hGetChar g ps2 <- hGetPS g (length s2) putStrLn (show (unpackPS ps2 == s2))
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | RE: Fail to compile 5.04.3 on Solaris, Josef Svenningsson |
|---|---|
| Next by Date: | RE: PackedString.hGetPS produces index exception, Simon Peyton-Jones |
| Previous by Thread: | [ ghc-Bugs-721511 ] Non-exhaustive patterns in ParseMonad.hs, SourceForge.net |
| Next by Thread: | Re: PackedString.hGetPS produces index exception, Sigbjorn Finne |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |