-- | Inline all type definitions at once.
inlineBase :: (Ord c, Ord tc, Ord tv)
  => TcEnv v c tc tv -> BaseInlState c tc tv
  -> Map tc [(Int, DataPat c tc tv)]
inlineBase env initState =
  let inl tc (vs, _) = inlineBaseS' env Set.empty tc (TcVar <$> vs)
      inlined = evalState (Map.traverseWithKey inl (tyConEnv env)) initState
  in Map.map (intWeights . snd) inlined
inlineBase :: (Ord c, Ord tc, Ord tv)
  => TcEnv v c tc tv -> BaseInlState c tc tv
  -> Map tc [(Int, DataPat c tc tv)]
inlineBase env initState =
  let inl tc (vs, _) = inlineBaseS' env Set.empty tc (TcVar <$> vs)
      inlined = evalState (Map.traverseWithKey inl (tyConEnv env)) initState
  in Map.map (intWeights . snd) inlined
inlineBase env initState =
  let inl tc (vs, _) = inlineBaseS' env Set.empty tc (TcVar <$> vs)
      inlined = evalState (Map.traverseWithKey inl (tyConEnv env)) initState
  in Map.map (intWeights . snd) inlined