-- Extract the set of variables that are judged in a context.
varsOfContext :: Ord a => TEContext a -> Set a
varsOfContext c = fromList (varsOfContext' c)
  where varsOfContext' [] = []
        varsOfContext' ((a, t) : rest) = a : (varsOfContext' rest)

-- Pick a fresh variable number
varsOfContext :: Ord a => TEContext a -> Set a
varsOfContext c = fromList (varsOfContext' c)
  where varsOfContext' [] = []
        varsOfContext' ((a, t) : rest) = a : (varsOfContext' rest)

-- Pick a fresh variable number
varsOfContext c = fromList (varsOfContext' c)
  where varsOfContext' [] = []
        varsOfContext' ((a, t) : rest) = a : (varsOfContext' rest)

-- Pick a fresh variable number