findSubstitutionCandidate :: Equations -> Maybe Equation
findSubstitutionCandidate equations = filterElement filterer equations
    where filterer equ@(TEVar v, t) = setContainsVar v (S.delete equ equations)
          filterer _ = False
findSubstitutionCandidate :: Equations -> Maybe Equation
findSubstitutionCandidate equations = filterElement filterer equations
    where filterer equ@(TEVar v, t) = setContainsVar v (S.delete equ equations)
          filterer _ = False
findSubstitutionCandidate equations = filterElement filterer equations
    where filterer equ@(TEVar v, t) = setContainsVar v (S.delete equ equations)
          filterer _ = False