checkInjectiveEquation :: FamInst -> TcM ()
checkInjectiveEquation famInst
    | isTypeFamilyTyCon tycon
    -- type family is injective in at least one argument
    , Injective inj <- tyConInjectivityInfo tycon = do
    { dflags <- getDynFlags
    ; let axiom = coAxiomSingleBranch fi_ax
          -- see Note [Verifying injectivity annotation] in FamInstEnv
    ; reportInjectivityErrors dflags fi_ax axiom inj
    }

    -- if there was no injectivity annotation or tycon does not represent a
    -- type family we report no conflicts
    | otherwise
    = return ()

    where tycon = famInstTyCon famInst
          fi_ax = fi_axiom famInst

-- | Report a list of injectivity errors together with their source locations.
-- Looks only at one equation; does not look for conflicts *among* equations.
checkInjectiveEquation :: FamInst -> TcM ()
checkInjectiveEquation famInst
    | isTypeFamilyTyCon tycon
    -- type family is injective in at least one argument
    , Injective inj <- tyConInjectivityInfo tycon = do
    { dflags <- getDynFlags
    ; let axiom = coAxiomSingleBranch fi_ax
          -- see Note [Verifying injectivity annotation] in FamInstEnv
    ; reportInjectivityErrors dflags fi_ax axiom inj
    }

    -- if there was no injectivity annotation or tycon does not represent a
    -- type family we report no conflicts
    | otherwise
    = return ()

    where tycon = famInstTyCon famInst
          fi_ax = fi_axiom famInst

-- | Report a list of injectivity errors together with their source locations.
-- Looks only at one equation; does not look for conflicts *among* equations.
checkInjectiveEquation famInst
    | isTypeFamilyTyCon tycon
    -- type family is injective in at least one argument
    , Injective inj <- tyConInjectivityInfo tycon = do
    { dflags <- getDynFlags
    ; let axiom = coAxiomSingleBranch fi_ax
          -- see Note [Verifying injectivity annotation] in FamInstEnv
    ; reportInjectivityErrors dflags fi_ax axiom inj
    }

    -- if there was no injectivity annotation or tycon does not represent a
    -- type family we report no conflicts
    | otherwise
    = return ()

    where tycon = famInstTyCon famInst
          fi_ax = fi_axiom famInst

-- | Report a list of injectivity errors together with their source locations.
-- Looks only at one equation; does not look for conflicts *among* equations.