- ClassP cls tys -> mkDictOcc (getOccName cls)
- IParam ip ty -> getOccName (ipNameName ip)
- EqPred _ _ -> pprPanic "mkPredName" (ppr pred_ty)
+ ClassP cls _ -> mkDictOcc (getOccName cls)
+ IParam ip _ -> getOccName (ipNameName ip)
+ EqPred ty _ -> mkEqPredCoOcc baseOcc
+ where
+ -- we use the outermost tycon of the lhs, which must be a type
+ -- function, as the base name for an equality
+ baseOcc = case splitTyConApp_maybe ty of
+ Nothing ->
+ pprPanic "Inst.mkPredName:" (ppr ty)
+ Just (tc, _) -> getOccName tc