Hello,
I've found this one when compiling pretty-printing combinators of
Swierstra & Azero:
$ ghc -c -O UU_Pretty.hs
$ ghc -v -c -O UU_Pretty_ext.hs
Glasgow Haskell Compiler, Version 5.00.1, for Haskell 98, compiled by
GHC version 4.08.2
Using package config file: /usr/local/lib/ghc-5.00.1/package.conf
Hsc static flags: -static -fignore-asserts -ffoldr-build-on
-fdo-eta-reduction -fdo-lambda-eta-expansion -fcase-merge -flet-to-case
-flet-no-escape
*** Ineffective C pre-processor
echo '{-# LINE 1 "UU_Pretty_ext.hs" #-}' > /tmp/ghc1712.hspp && cat
UU_Pretty_ext.hs >> /tmp/ghc1712.hspp
*** Checking old interface for hs = Just "UU_Pretty_ext.hs", hspp = Just
"/tmp/ghc1712.hspp":
Compiling UU_Pretty_ext ( UU_Pretty_ext.hs, UU_Pretty_ext.o )
...
(skipped output from various passes, and then...)
*** Constructed Product analysis:
Removing: /tmp/ghc1712.hc
Warning: can't remove tmp file /tmp/ghc1712.hc
Removing: /tmp/ghc1712.hspp
ghc-5.00.1: panic! (the `impossible' happened, GHC version 5.00.1):
CPR Analysis tried to take the lub of a function and a tuple
I've extracted and simplified few offending definitions from original
modules and ended up with the following files (in fact, the ghc output
above resulted from compiling these simplified files):
UU_Pretty.hs, containing
------------------------------
module UU_Pretty where
infixr 2 >-<
newtype PP_Doc = PPDoc T_PPS
class Show a => PP a where
pp :: a -> PP_Doc
pp = undefined
instance PP PP_Doc where
pp = undefined
instance Show PP_Doc where
show _ = undefined
empty :: PP_Doc
empty = PPDoc (sem_PPS_Above undefined undefined)
(>-<) :: (PP a, PP b) => a -> b -> PP_Doc
u >-< l = PPDoc (sem_PPS_Above ppu ppl)
where (PPDoc ppu) = pp u
(PPDoc ppl) = pp l
type T_PPS = Int -> (Int, Int, Int, Int)
sem_PPS_Above :: T_PPS -> T_PPS -> T_PPS
sem_PPS_Above upper lower _
= let (_, a1, _, a3) = upper 0
(_, b1, b2, b3) = lower 0
in (0, a1 + b1, b2, a3 + b3)
------------------------------
and UU_Pretty_ext.hs, with just
------------------------------
module UU_Pretty_ext where
import UU_Pretty
vlist :: PP a => [a] -> PP_Doc
vlist = foldr (>-<) empty
------------------------------
Yes, I know it's a known bug, but maybe this posting will help to track
it down someday.
--
Artur Zawlocki
[EMAIL PROTECTED]
--
Ile zarabiasz? Wypelnij ankiete,
dowiesz sie jak zarabiac wiecej [ http://listaplac.onet.pl ]
_______________________________________________
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
CPR Analysis bug in ghc 5.00.1
Artur =?x-user-defined?q?Zaw=B3ocki?= Tue, 12 Jun 2001 14:46:15 -0700
- RE: CPR Analysis bug in ghc 5.00.1 Artur =?x-user-defined?q?Zaw=B3ocki?=
- RE: CPR Analysis bug in ghc 5.0... Julian Seward (Intl Vendor)
