Core language

Imports and packages

Import modules and use the main namespace families.

What

Imports let you pull shared code into the current file: standard features from @std and lower-level building blocks from musi:* when needed.

Why

This keeps code short and reusable while avoiding copy-paste or duplicated helpers.

How

Add imports at the top of your file, then use imported names directly in regular expressions.

Compare

Import the standard library, then reach the family you need. Musi keeps stdlib access explicit through @std.

Musi package imports are values, so @std becomes a normal binding you can pass around.

let Std := import "@std";
let Option := Std.Option;

When

Use imports in most new files.

  • Start with @std for everyday tasks.
  • Use musi:* for boundary-level interoperability and foundation-level work.

Analogy

Like Python imports or TypeScript module imports: one place for shared functionality, one place for lower-level tools.

Try it

Replace duplicated snippets with imported names, then continue to Data and pattern matching.