Specializer loops while applying rewrite rules
Compiling the following module on GHC HEAD causes the specializer to diverge:
{-# OPTIONS_GHC -O1 #-}
module T22802 where
class C a where
f :: a -> a -> a
g :: a -> a -> a
instance C () where
f = g
g = f
h :: [()] -> ()
h = foldr f () . map (const ())
The program compiles on 9.4, so this is a regression in 9.6. This is almost certainly caused by f9f17b68, as the reproduction depends on the RULES defined on foldr
and map
.