Re: classes and template haskell (bug?)

2003-12-31 Thread Jeremy Shaw
Hello, I attempted to build cvs head but it died with the following error: /usr/bin/ghc6 -H16m -O -istage1/utils -istage1/basicTypes -istage1/types -istage1/hsSyn -istage1/prelude -istage1/rename -istage1/typecheck -istage1/deSugar -istage1/coreSyn -istage1/specialise -istage1/simplC

Re: Running a "final" finaliser

2003-12-31 Thread Adrian Hey
On Wednesday 31 Dec 2003 8:56 am, Adrian Hey wrote: > Intended use is something like this... > > {-# notInline libXYZRef #-} > libXYZRef :: LibRef > libXYZRef = unsafePerformIO newLibRef > > main :: IO () > main = finally (initLibXYZ >> userMain) (killLibRef libXYZRef > shutDownLibXYZ) > -- initLi

Re: Running a "final" finaliser

2003-12-31 Thread Adrian Hey
On Wednesday 31 Dec 2003 8:56 am, Adrian Hey wrote: > The problem is I get a "fail: <>" error if no garbage collection > has occured when killLibRef is called (I.E. killLibRef saves shutDownLibXYZ > for later use because the reference count is non-zero). Sorry, I should clarify this. The error doe

Re: Running a "final" finaliser

2003-12-31 Thread Adrian Hey
Hello again, I've tried the simplest possible reference counting approach which should be OK if all finalisers are run eventually (as I think is the case currently with ghc 6.2). But I don't seem to be able to get it to work. I've attached the library reference counting code (LibRef module) to th

RE: classes and template haskell (bug?)

2003-12-31 Thread Simon Peyton-Jones
In GHC 6.2, Template Haskell has various bugs. I think they are all fixed in the HEAD, so you can either build from source or grab a development snapshot from the GHC site. The HEAD version of TH has a slightly different programming interface too -- see http://research.microsoft.com/~simo