Armin Groesslinger wrote:
> I think I have found an optimisation problem in GHC
> pre-4.07-20000613. [...]

Cool bug!   :-)   The example can be cut down further to:

----------------------------------------------------
main :: IO ()
main = print (length (filter (not . foo)
                             (filter (const False) [Nothing])))
  where foo (Just x) = x
        foo _        = error "foo"
----------------------------------------------------

After some experiments it seems that the RULE for filterFB is
the wrong:

   "filterFB" forall c p q. filterFB (filterFB c p) q = filterFB c (\x -> p x && q x)

At least everything works when it is removed from the corresponding
interface file. Perhaps I'll have a closer look later.

Cheers,
   Sven

Reply via email to