uniteUnique :: forall a . Eq a => TEContext a -> TEContext a -> TEContext a
uniteUnique ctxt1 ctxt2 = nub $ ctxt1 ++ (map mapper ctxt2)
  where mapper :: TECtxtJudgment a -> TECtxtJudgment a
        mapper (v,t) = case varTypeJudgment v ctxt1 of
                            Just (vv,tt) -> (vv,tt)
                            Nothing -> (v,t)

-- Create equations that equate types of duplicate judgements
uniteUnique :: forall a . Eq a => TEContext a -> TEContext a -> TEContext a
uniteUnique ctxt1 ctxt2 = nub $ ctxt1 ++ (map mapper ctxt2)
  where mapper :: TECtxtJudgment a -> TECtxtJudgment a
        mapper (v,t) = case varTypeJudgment v ctxt1 of
                            Just (vv,tt) -> (vv,tt)
                            Nothing -> (v,t)

-- Create equations that equate types of duplicate judgements
uniteUnique ctxt1 ctxt2 = nub $ ctxt1 ++ (map mapper ctxt2)
  where mapper :: TECtxtJudgment a -> TECtxtJudgment a
        mapper (v,t) = case varTypeJudgment v ctxt1 of
                            Just (vv,tt) -> (vv,tt)
                            Nothing -> (v,t)

-- Create equations that equate types of duplicate judgements