getEqPredRole :: PredType -> Role
getEqPredRole ty
  = case splitTyConApp_maybe ty of
      Just (tc, [_, _, _])
        | tc `hasKey` eqTyConKey -> Nominal
        | tc `hasKey` coercibleTyConKey -> Representational
      _ -> pprPanic "getEqPredRole" (ppr ty)

-- | Get the equality relation relevant for a pred type.
getEqPredRole :: PredType -> Role
getEqPredRole ty
  = case splitTyConApp_maybe ty of
      Just (tc, [_, _, _])
        | tc `hasKey` eqTyConKey -> Nominal
        | tc `hasKey` coercibleTyConKey -> Representational
      _ -> pprPanic "getEqPredRole" (ppr ty)

-- | Get the equality relation relevant for a pred type.
getEqPredRole ty
  = case splitTyConApp_maybe ty of
      Just (tc, [_, _, _])
        | tc `hasKey` eqTyConKey -> Nominal
        | tc `hasKey` coercibleTyConKey -> Representational
      _ -> pprPanic "getEqPredRole" (ppr ty)

-- | Get the equality relation relevant for a pred type.