Bug? Unique class names...
Keean Schupke <[email protected]>
| Newsgroups | gmane.comp.lang.haskell.template |
|---|---|
| Message-ID | <[email protected]> |
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.