#2480: error function is not lazy
-----------------------------+----------------------------------------------
    Reporter:  NeilMitchell  |       Owner:          
        Type:  bug           |      Status:  new     
    Priority:  normal        |   Component:  Compiler
     Version:  6.8.3         |    Severity:  normal  
    Keywords:                |    Testcase:          
Architecture:  Unknown       |          Os:  Windows 
-----------------------------+----------------------------------------------
 {{{
 C:\Neil\Temp>type Test.hs
 main = error $ cycle "Hello\n"
 C:\Neil\Temp>ghc --make Test.hs
 [1 of 1] Compiling Main             ( Test.hs, Test.o )
 Linking Test.exe ...
 C:\Neil\Temp>test
 -- hangs forever
 }}}

 The error message seems to get buffered, which means long/infinite
 messages are never displayed. GHCi does evaluate error lazily. The error
 function is particularly useful for debugging, which is where I
 encountered this problem.

 It appears trace has a similar issue of buffering in GHC compiled
 programs, but I am not certain.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2480>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to