Need help on Ptr

Christian Buschmann
Thu, 15 May 2003 22:07:56 +0200

Hal Daume III wrote:
> Why not:
>   isNullPtr = (==nullPtr)
> ?
Oh sure....sorry....
i tried this before, but i had a small confusion with my type-signatures 
in my program and it didn't work. Now i fixed my signatures and its 
But there is one more (small) question:
If i am using the "peekCString" function with a null-pointer my program 
crashes, because the peekCString function is trying to read a String 
from an illegal address. But is this normal behaviour of this function? 
Shouldn't it check for a null-pointer and then return an empty String, 
raise an exception or do something else than crashing my program?

Oh, and my compiler is ghc-5.04.2 on linux-2.4.20