-- | Transforms a Toaster program to a C-like representation for LLVM code
-- generation.
prep :: [TlExpr] -> DebugOr [TlExpr]
prep tls = do
  let tls' = correctMain tls
  cs <- removeNonConcrete tls'
  resolved <- resolve builtinsCtx cs
  mangled <- mangle resolved
  return $ delambdaTopLevel mangled

-- | Removes all non-concrete code.
prep :: [TlExpr] -> DebugOr [TlExpr]
prep tls = do
  let tls' = correctMain tls
  cs <- removeNonConcrete tls'
  resolved <- resolve builtinsCtx cs
  mangled <- mangle resolved
  return $ delambdaTopLevel mangled

-- | Removes all non-concrete code.
prep tls = do
  let tls' = correctMain tls
  cs <- removeNonConcrete tls'
  resolved <- resolve builtinsCtx cs
  mangled <- mangle resolved
  return $ delambdaTopLevel mangled

-- | Removes all non-concrete code.