Opened 3 years ago

Closed 3 years ago

#9745 closed bug (duplicate)

qual_pkg panic with template haskell

Reported by: luite Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.9
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: #10279 Differential Rev(s):
Wiki Page:

Description

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@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:

{-# 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.

Attachments (3)

lenstest-0.1.0.0.tar.gz (567 bytes) - added by luite 3 years ago.
lenstest package
free-4.9.0.1.tar.gz (42.6 KB) - added by luite 3 years ago.
free package
semigroups-0.15.3.1.tar.gz (11.6 KB) - added by luite 3 years ago.
semigroups

Download all attachments as: .zip

Change History (10)

Changed 3 years ago by luite

Attachment: lenstest-0.1.0.0.tar.gz added

lenstest package

Changed 3 years ago by luite

Attachment: free-4.9.0.1.tar.gz added

free package

comment:1 Changed 3 years ago by luite

Sorry, the updated lens package couldn't be attached because it's bigger than the 256kB file size limit. Get it here:

http://hdiff.luite.com/tmp/lens-4.5.0.0.1.tar.gz

comment:2 Changed 3 years ago by ezyang

Owner: set to ezyang

comment:3 Changed 3 years ago by ezyang

semigroups doesn't seem to compile for me, what version are you using?

Changed 3 years ago by luite

Attachment: semigroups-0.15.3.1.tar.gz added

semigroups

comment:5 Changed 3 years ago by ezyang

Resolution: invalid
Status: newclosed

Ahhh, very nice catch! I grepped for key like things but I must have missed this. So, let's close as not our bug...

comment:6 Changed 3 years ago by ezyang

Owner: ezyang deleted
Resolution: invalid
Status: closednew

comment:7 Changed 3 years ago by ezyang

Resolution: duplicate
Status: newclosed

We decided that there are some fixes we should do here, see #10279

Note: See TracTickets for help on using tickets.