Re: [Haskell-cafe] Crash in Data.ByteString.Lazy.hPut

2008-01-28 Thread Don Stewart
jamie.love: Hi there, Not sure where to raise bugs in hackage libraries, so I'm posting here. If there is a better place, please let me know. The following code crashes with a divide by zero error when using the package 'binary-0.4.' Oh, hehe. \x - x `mod` 256 doesn't work if x ::

[Haskell-cafe] Crash in Data.ByteString.Lazy.hPut

2008-01-28 Thread Jamie Love
Hi there, Not sure where to raise bugs in hackage libraries, so I'm posting here. If there is a better place, please let me know. The following code crashes with a divide by zero error when using the package 'binary-0.4.' module Main where import IO import Data.Binary import

Re: [Haskell-cafe] Crash in Data.ByteString.Lazy.hPut

2008-01-28 Thread Don Stewart
jamie.love: Hi there, Not sure where to raise bugs in hackage libraries, so I'm posting here. If there is a better place, please let me know. The following code crashes with a divide by zero error when using the package 'binary-0.4.' Can you repeat this with binary 0.4.1 please? (And

Re: [Haskell-cafe] Crash in Data.ByteString.Lazy.hPut

2008-01-28 Thread Brandon S. Allbery KF8NH
On Jan 28, 2008, at 17:33 , Jamie Love wrote: Shouldn't haskell pick up that there is no 'mod' for Word8? I mean, shouldn't I get a nicer error message? Hm? mod works fine for Word8, unless you specify a multiple of the type's bound. I think it's still hard for compilers to catch that

Re: [Haskell-cafe] Crash in Data.ByteString.Lazy.hPut

2008-01-28 Thread Don Stewart
jamie.love: Ah, of course. Thanks. I removed the hPut and it runs smoothly. I had forgotten that haskell chooses the types dynamically. Shouldn't haskell pick up that there is no 'mod' for Word8? I mean, shouldn't I get a nicer error message? Well, it inferred Word8 for

Re: [Haskell-cafe] Crash in Data.ByteString.Lazy.hPut

2008-01-28 Thread Jamie Love
Oh, I see I wasn't thinking through the code (and I'm still in the honeymoon phase with Haskell, thinking it can do no wrong). Don Stewart wrote: jamie.love: Ah, of course. Thanks. I removed the hPut and it runs smoothly. I had forgotten that haskell chooses the types

Re: [Haskell-cafe] Crash in Data.ByteString.Lazy.hPut

2008-01-28 Thread Jamie Love
Ah, of course. Thanks. I removed the hPut and it runs smoothly. I had forgotten that haskell chooses the types dynamically. Shouldn't haskell pick up that there is no 'mod' for Word8? I mean, shouldn't I get a nicer error message? Don Stewart wrote: jamie.love: Hi there, Not sure

Re: [Haskell-cafe] Crash in Data.ByteString.Lazy.hPut

2008-01-28 Thread Jamie Love
Just to clarify, I know it was my mistake, and so I'm not blaming Haskell or Ghc. The first few times you realise the compiler isn't a magic wand that stops you being silly are the hardest. Jamie Love wrote: Oh, I see I wasn't thinking through the code (and I'm still in the honeymoon

Re: [Haskell-cafe] Crash in Data.ByteString.Lazy.hPut

2008-01-28 Thread Jamie Love
I should point out that this is on GHC 6.8.2 compiled from source on a Mac powerpc. Jamie Love wrote: Hi there, Not sure where to raise bugs in hackage libraries, so I'm posting here. If there is a better place, please let me know. The following code crashes with a divide by zero error

Re: [Haskell-cafe] Crash in Data.ByteString.Lazy.hPut

2008-01-28 Thread Stephan Friedrichs
Brandon S. Allbery KF8NH wrote: On Jan 28, 2008, at 17:33 , Jamie Love wrote: Shouldn't haskell pick up that there is no 'mod' for Word8? I mean, shouldn't I get a nicer error message? Hm? mod works fine for Word8, unless you specify a multiple of the type's bound. I think it's still