
3 May
2007
3 May
'07
3:57 a.m.
Neil Mitchell wrote:
Hi
Thanks to dcoutts, I have now come up with an answer. I don't understand why it works now, but not before. I do remember than browsing either Core or STG is not a fun thing to do...
p_System_IO_hGetChar h = trace "i am here" $ unsafePerformIO $ getCharIO h
{-# NOINLINE getCharIO #-} getCharIO h = do c <- getchar print c return $ if c == (-1) then 0 else chr_ c
This is clearly a misuse of unsafePerformIO (as I'm sure you're aware). Just out of interest - what's the context? Cheers, Simon