tmAlt :: (Eq a, TmAstBound ki ty pt tm, TmAstTransversable ki ty pt tm) => Pattern pt a -> Term ki ty pt tm a -> Alt ki ty pt (TmAst ki ty pt tm) (TmAstVar a)
tmAlt p tm = Alt (review _TmPattern p) s
  where
    vs = fmap TmAstTmVar . toList $ p
    s = abstract (`elemIndex` vs) . review _Unwrapped $ tm
tmAlt :: (Eq a, TmAstBound ki ty pt tm, TmAstTransversable ki ty pt tm) => Pattern pt a -> Term ki ty pt tm a -> Alt ki ty pt (TmAst ki ty pt tm) (TmAstVar a)
tmAlt p tm = Alt (review _TmPattern p) s
  where
    vs = fmap TmAstTmVar . toList $ p
    s = abstract (`elemIndex` vs) . review _Unwrapped $ tm
tmAlt p tm = Alt (review _TmPattern p) s
  where
    vs = fmap TmAstTmVar . toList $ p
    s = abstract (`elemIndex` vs) . review _Unwrapped $ tm