Thomas Absolutely right! There is a total omission in the TH implementation for the free 'x' in \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 | | Hi, | | while experimenting with template haskell I encountered the following: | | ] 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 | | This was using a version very recently checked out of CVS (Friday, 14 March) | | The files that caused the problem are attached. | | -- | Tom Harke | Computer Science and Engineering Department | Oregon Graduate Institute | | Weiler's Law: | Nothing is impossible for the man who doesn't have to do it himself
participants (1)
-
Simon Peyton-Jones