[Template-haskell] RE: ghc-5.05 / template haskell bug

Simon Peyton-Jones simonpj@microsoft.com
Tue, 8 Apr 2003 17:33:10 +0100


Thomas

Absolutely right!  There is a total omission in the TH implementation
for the free 'x' in=20
	\x -> $(power 2 [| x |])

You can get round this in a clunky way by wrapping the whole thing in
$[| |], thus

	$([| \x -> $(power 2 [| x |]) |])

This works, but it's not pretty.  The Right Thing is to fix it, which I
hope to do.

thanks for pointing this out.  TH is pretty subtle

Simon

|  -----Original Message-----
|  From: Thomas Harke [mailto:harke@cse.ogi.edu]
|  Sent: 10 March 2003 18:15
|  To: glasgow-haskell-bugs@haskell.org
| =20
|  Hi,
| =20
|  while experimenting with template haskell I encountered the
following:
| =20
|  ] ghc --make Main.hs
|  ] Chasing modules from: Main.hs
|  ] Skipping  Power            ( Power.hs, ./Power.o )
|  ] Compiling Main             ( Main.hs, ./Main.o )
|  ] ghc-5.05: panic! (the `impossible' happened, GHC version 5.05):
|  ]         nameModule x {- v a1fV -}
|  ]
|  ] Please report it as a compiler bug to
glasgow-haskell-bugs@haskell.org,
|  ] or http://sourceforge.net/projects/ghc/.
|  ]
|  ]
|  ] make: *** [main] Error 1
| =20
|  This was using a version very recently checked out of CVS (Friday, 14
March)
| =20
|  The files that caused the problem are attached.
| =20
|  --
|  Tom Harke
|  Computer Science and Engineering Department
|  Oregon Graduate Institute
| =20
|  Weiler's Law:
|    Nothing is impossible for the man who doesn't have to do it himself