classes and template haskell (bug?)

Simon Peyton-Jones simonpj at microsoft.com
Wed Dec 31 08:11:47 EST 2003


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/~simonpj/tmp/notes2.ps

Simon

| -----Original Message-----
| From: glasgow-haskell-users-bounces at haskell.org
[mailto:glasgow-haskell-users-
| bounces at haskell.org] On Behalf Of Jeremy Shaw
| Sent: 31 December 2003 02:19
| To: glasgow-haskell-users at haskell.org
| Subject: classes and template haskell (bug?)
| 
| Hello,
| 
| I have loaded the following from a file into ghci 6.2:
| 
| module Main where
| 
| import Language.Haskell.THSyntax
| 
| class Test a where
|     test :: a -> a
| 
| instance Test (a,b,c) where
|     test x = x
| 
| main = putStrLn "Hello, World!"
| 
| This works for me:
| 
| *Main> runQ [d| instance Test (Int,Int) |] >>= putStrLn . show
| [InstanceD [] (AppT (ConT "Main:Test") (AppT (AppT (TupleT 2) (ConT
"GHC.Base:Int")) (ConT
| "GHC.Base:Int"))) []]
| 
| But this doesn't:
| 
| *Main> runQ [d| instance Test (a,b) |] >>= putStrLn . show
| ghc-6.2: panic! (the `impossible' happened, GHC version 6.2):
| 	Failed binder lookup: a {- tv a20x -}
| 
| Please report it as a compiler bug to
glasgow-haskell-bugs at haskell.org,
| or http://sourceforge.net/projects/ghc/.
| 
| 
| Am I doing something wrong, or is this a bug?
| 
| Thanks!
| Jeremy Shaw.
| _______________________________________________
| Glasgow-haskell-users mailing list
| Glasgow-haskell-users at haskell.org
| http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


More information about the Glasgow-haskell-users mailing list