termReduction :: Equations -> Equations
termReduction equations =
    case findArrowEquation equations of
         Just arrow@(TEArrow t1 t2, TEArrow t1' t2') ->
             let newSet = S.union (fromList [(t1, t1'), (t2, t2')])
                                  (S.delete arrow equations)
                 in termReduction newSet
         Nothing -> equations
         _ -> error "unexpected value from findArrowEquation"

-- STEP 2: Check for offending equations
termReduction :: Equations -> Equations
termReduction equations =
    case findArrowEquation equations of
         Just arrow@(TEArrow t1 t2, TEArrow t1' t2') ->
             let newSet = S.union (fromList [(t1, t1'), (t2, t2')])
                                  (S.delete arrow equations)
                 in termReduction newSet
         Nothing -> equations
         _ -> error "unexpected value from findArrowEquation"

-- STEP 2: Check for offending equations
termReduction equations =
    case findArrowEquation equations of
         Just arrow@(TEArrow t1 t2, TEArrow t1' t2') ->
             let newSet = S.union (fromList [(t1, t1'), (t2, t2')])
                                  (S.delete arrow equations)
                 in termReduction newSet
         Nothing -> equations
         _ -> error "unexpected value from findArrowEquation"

-- STEP 2: Check for offending equations