[Haskell-cafe] GHC 6.7 on Windows / containers-0.1 package?

Peter Verswyvelen bf3 at telenet.be
Fri Sep 21 15:38:36 EDT 2007

Thanks for the info, very interesting. Yes, I'm using GHCi, and I'm 
using forkOS, and I'm using OpenGL...

Since I'm used to write heavily multi-threaded/multi-core code in 
imperative languages, I would like to understand more about the existing 
execution models, and those "black holes"... Understanding the low-level 
details helps a lot for me.

Actually the problem was caused by (yet another) strict pattern match in 
my code, which should have been lazy. I find it strange that this would 
cause 0% CPU time... But then again I don't understand the details of 
how GHCi/GHC works. I did read the book "Modern Compiler Design" 
(http://www.cs.vu.nl/~dick/MCD.html) which implements a basic Haskell 
interpreter & compiler, so I got an introduction.

Anyway, it's a very good learning experience for me to "redo" FRP from 
scratch, as I encounter all pitfalls (such as the need for memoization 
when using recursive streams, the need for lazy pattern matching, the 
space leaks sneaking up on you, etc). Once I get to understand these in 
detail, I'll try to re-read the existing papers on FRP, which I hardly 
understood initially :-)


Stefan O'Rear wrote:
> On Wed, Sep 19, 2007 at 10:24:24PM +0100, Neil Mitchell wrote:
>> Hi Peter,
>>>  So I grabbed ghc-6.7.20070824 (=the latest one for Windows I could find)
>>> and the "extra-libs", compiled and installed the GLUT package (which I
>>> needed), but when I compile my library, I get
>>>      Could not find module `Data.Map':
>>>        it is a member of package containers-0.1, which is hidden
>> All dependencies etc. have changed when going to 6.7/6.8 - you are
>> probably better off using 6.6.1 for now.
>> I also don't think that the debugger will help you track down infinite
>> loop style errors. You might be better off posting the code and asking
>> for help.
> You said 0% CPU.  That's *very* important.  It means that you are using
> the threaded runtime (GHCi?), and that you triggered a blackhole.  You
> should be able to handle this by compiling your program with -prof (do
> *not* use -threaded!), and running with +RTS -xc.  With luck, that will
> give you a backtrace to the infinite loop.
> PS. blackholes are a serious dark corner of GHC's execution model,
> chances are better than even that if you try to use the debugger for
> this you will discover a new and (for you) crippling bug.  I wouldn't
> recommend it.
> Stefan

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

More information about the Haskell-Cafe mailing list