prettyProg :: Pretty a => Config -> Name -> a -> (Builder, Builder)
prettyProg cfg mainSym ast = runPP cfg $ do
  pp ast
  hsnames <- getOpt preserveNames
  if hsnames
    then return $ buildStgName mainSym
    else buildFinalName <$> finalNameFor mainSym

-- | JS-mangled version of an internal name.
prettyProg :: Pretty a => Config -> Name -> a -> (Builder, Builder)
prettyProg cfg mainSym ast = runPP cfg $ do
  pp ast
  hsnames <- getOpt preserveNames
  if hsnames
    then return $ buildStgName mainSym
    else buildFinalName <$> finalNameFor mainSym

-- | JS-mangled version of an internal name.
prettyProg cfg mainSym ast = runPP cfg $ do
  pp ast
  hsnames <- getOpt preserveNames
  if hsnames
    then return $ buildStgName mainSym
    else buildFinalName <$> finalNameFor mainSym

-- | JS-mangled version of an internal name.