Language
Modules
Tea uses `use alias = "module.path"` imports for stdlib modules and relative Tea files.
Modules let you split code across files and control which functions are part of the public API. In Tea, you import modules with use alias = "path" and call exported members through that alias.
Export from a local file
Mark exported definitions with pub. Anything without pub stays private to that module, which keeps internal helpers out of the external surface.
pub def triple(value: Int) -> Int
return value * 3
end
def internal_label() -> String
return "helpers"
endImport it from another file
Relative imports point to nearby Tea files. Bind the import to an alias, then access exported members through that name.
use helpers = "./helpers"
@println(helpers.triple(5))Stdlib imports
Checked-in examples use imports like use args = "std.args",
use fs = "std.fs", and use regex = "std.regex". Each
stdlib module exposes its public API from a mod.tea entrypoint.