[Haskell-cafe] what is f=f (not) doing ?

Peter Verswyvelen bf3 at telenet.be
Sat Sep 22 06:54:20 EDT 2007


I guess you entered a black hole! :-)

The problem is that don't understand black holes myself, I just got 
introduced with the same thing yesterday :-) I confused me a lot too.

The only explanation I could give you intuitively is that GHCi is 
running in multi threaded execution mode, and that two or more execution 
threads are waiting for each other forever, creating a "deadlock".

http://www.haskell.org/ghc/docs/2.10/users_guide/user_146.html 
<http://www.haskell.org/ghc/docs/2.10/users_guide/user_146.html>seems to 
confirm that?

If you try the same using (Win)HUGS, you'll get 100% CPU time usage.

Cheers,
Peter Verswyvelen

Pasqualino 'Titto' Assini wrote:
> Hi,
>
> if I define:
>
> f = f
>
> and then try to evaluate 'f'  in GHCi, as one would expect, the interpreter 
> never returns an answer.
>
> The funny thing is that, while it is stuck in an infinite loop, GHCi doesn't 
> seem to use any CPU time at all.
>
> How is this possible?
>
> Thanks
>
>             titto
>
>
>
>
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20070922/4c2e027d/attachment.htm


More information about the Haskell-Cafe mailing list