The prelude package provides a set of commonly used types, traits, and functions that are automatically available in every MoonBit program without requiring explicit imports. This includes core data structures like Array, Map, and Set, as well as essential utilities for error handling, debugging, and I/O.
// Example of using prelude types like Set directly
test "Set constructor from prelude" {
let set = Set([1, 2, 3, 4])
inspect(set.length(), content="4")
inspect(set.contains(3), content="true")
}