mergePat :: IState -> PTerm -> PTerm -> Maybe Name -> State MergeState PTerm
-- If any names are unified, make sure they stay unified. Always prefer
-- user provided name (first pattern)
mergePat ist (PPatvar fc n) new t
  = mergePat ist (PRef fc [] n) new t
mergePat :: IState -> PTerm -> PTerm -> Maybe Name -> State MergeState PTerm
mergePat ist (PPatvar fc n) new t
  = mergePat ist (PRef fc [] n) new t
mergePat ist (PPatvar fc n) new t
  = mergePat ist (PRef fc [] n) new t