[GHC] #9745: qual_pkg panic with template haskell

GHC ghc-devs at haskell.org
Thu Oct 30 20:42:33 UTC 2014


#9745: qual_pkg panic with template haskell
-------------------------------------+-------------------------------------
       Reporter:  luite              |                   Owner:
           Type:  bug                |                  Status:  new
       Priority:  normal             |               Milestone:
      Component:  Compiler           |                 Version:  7.9
       Keywords:                     |        Operating System:
   Architecture:  Unknown/Multiple   |  Unknown/Multiple
     Difficulty:  Unknown            |         Type of failure:
     Blocked By:                     |  None/Unknown
Related Tickets:                     |               Test Case:
                                     |                Blocking:
                                     |  Differential Revisions:
-------------------------------------+-------------------------------------
 I'm updating some things that use Template Haskell to derive lenses to
 work with GHC HEAD, but I'm getting the following error. My `cabal-
 install` a fresh build from the master branch of the `cabal` repository.

 {{{
 src/Lib.hs:11:1:ghc: panic! (the 'impossible' happened)
   (GHC version 7.9.20141029 for x86_64-unknown-linux):
         qual_pkg lens-4.5.0.0.1
 }}}

 lenstest.cabal
 {{{
 name:                lenstest
 version:             0.1.0.0
 license-file:        LICENSE
 author:              Luite Stegeman
 maintainer:          stegeman at gmail.com
 build-type:          Simple
 cabal-version:       >=1.10

 library
   build-depends: base >= 4.8 && < 4.9,
                  lens >= 4.5
   exposed-modules: Lib
   default-language: Haskell2010
   hs-source-dirs: src

 }}}
 src/Lib.hs:
 {{{#!hs
 {-# LANGUAGE TemplateHaskell #-}

 module Lib where

 import Control.Lens

 data XY = X Int
         | Y String

 makeLenses ''XY
 makePrisms ''XY
 }}}

 The `lens` and `free` packages need to be patched to work with the latest
 GHC, because of a conflict with `Data.Bifunctor`. I've attached updated
 version that use `PackageImports` to get the module from `bifunctors` as a
 workaround.

 Use
 {{{
 cabal install --allow-newer
 }}}
 to install, since some dependencies have too restrictive upper bounds.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9745>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list