Template Haskell panic

George Russell ger at informatik.uni-bremen.de
Wed Dec 10 12:06:46 EST 2003


The attached file causes a panic when compiled with ghc6.0 on Linux.

# ghc -fglasgow-exts TH.hs -c
ghc-6.0.1: panic! (the `impossible' happened, GHC version 6.0.1):
	nameModule newLen0 {- v a35 -}

Please report it as a compiler bug to glasgow-haskell-bugs at haskell.org,
or http://sourceforge.net/projects/ghc/.
-------------- next part --------------
module T where

bp :: Int -> IO Int
bp newLen0 =
   do
      let
         newLen =
            $( 
               -- work around GHC6 bug
               if True
                  then
                     [| max 1 newLen0 |]
                  else
                     [| newLen0 |]
               )
      return newLen


More information about the Glasgow-haskell-bugs mailing list