-- | Inline a type definition.
--
-- By this, we mean to unfold partial values as much as possible,
-- potentially increasing their number, but decreasing the number of
-- lookups of auxiliary generators as well as calls to a RNG.
inlineTc :: (Ord c, Ord tc, Ord tv)
  => TcEnv v c tc tv -> Set tc -> tc -> ([tv], [c]) -> [(Weight, DataPat c tc tv)]
inlineTc env baseTcs tc (vs, _) =
  let targs = TcVar <$> vs
      Right r = evalState
        (runExceptT $ inlineS' env Set.empty tc targs)
        (InlState (Set.insert tc baseTcs))
  in r
inlineTc :: (Ord c, Ord tc, Ord tv)
  => TcEnv v c tc tv -> Set tc -> tc -> ([tv], [c]) -> [(Weight, DataPat c tc tv)]
inlineTc env baseTcs tc (vs, _) =
  let targs = TcVar <$> vs
      Right r = evalState
        (runExceptT $ inlineS' env Set.empty tc targs)
        (InlState (Set.insert tc baseTcs))
  in r
inlineTc env baseTcs tc (vs, _) =
  let targs = TcVar <$> vs
      Right r = evalState
        (runExceptT $ inlineS' env Set.empty tc targs)
        (InlState (Set.insert tc baseTcs))
  in r