correctMain :: [TlExpr] -> [TlExpr]
correctMain = map replaceIfMain
  where
    replaceIfMain tl = case tl of
      TlDef "main" (Unquantified t) e -> TlFuncDef "main" [] t e
      _ -> tl

-- | Mangles all names by type to ensure uniqueness.
correctMain :: [TlExpr] -> [TlExpr]
correctMain = map replaceIfMain
  where
    replaceIfMain tl = case tl of
      TlDef "main" (Unquantified t) e -> TlFuncDef "main" [] t e
      _ -> tl

-- | Mangles all names by type to ensure uniqueness.
correctMain = map replaceIfMain
  where
    replaceIfMain tl = case tl of
      TlDef "main" (Unquantified t) e -> TlFuncDef "main" [] t e
      _ -> tl

-- | Mangles all names by type to ensure uniqueness.