[Template-haskell] Bug? Unique class names...

Keean Schupke k.schupke at imperial.ac.uk
Fri Nov 26 10:07:30 EST 2004


Is it possible you could point me to the right part of the ghc source to 
fix, so that
I can patch it and carry on working in the meantime?

    Keean.


Simon Peyton-Jones wrote

>It's all part of this newName stuff I wrote about.  I hope to have it
>done in a week or so
>
>| -----Original Message-----
>| From: template-haskell-bounces at haskell.org
>[mailto:template-haskell-bounces at haskell.org] On
>| Behalf Of Keean Schupke
>| Sent: 26 November 2004 11:09
>| To: Ian Lynagh
>| Cc: template-haskell at haskell.org; Simon Peyton-Jones
>| Subject: [Template-haskell] Bug? Unique class names...
>| 
>| Hi,
>|     I am trying to generate classes on the fly... as classes may get
>| generated more
>| than once, I want guaranteed unique names (sounds like a job for
>newName)...
>| However, whilst the first example works, the second fails:
>| 
>|  >-- this works
>|  >test :: Q [Dec]
>|  >test = do
>|  >   k <- newName "k"
>|  >   c <- classD (cxt []) (mkName "MyClass") [k] [] []
>|  >   return [c]
>| 
>|  >-- this fails
>|  >test :: Q [Dec]
>|  >test = do
>|  >   n <- newName "MyClass"
>|  >   k <- newName "k"
>|  >   c <- classD (cxt []) n [k] [] []
>|  >   return [c]
>| 
>| In the second case this error is given:
>| 
>|     ghc-6.3: panic! (the `impossible' happened, GHC version 6.3):
>|             nameModule MyClass{tc a3dX}
>| 
>| Is this a bug? How easy is it to fix?
>| 
>|     Regards,
>|     Keean.
>| 
>| 
>| _______________________________________________
>| template-haskell mailing list
>| template-haskell at haskell.org
>| http://www.haskell.org/mailman/listinfo/template-haskell
>  
>



More information about the template-haskell mailing list