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
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