Skip to content

CEP-0037: Impl-Only Imports

Draft

Draft proposal for importing implementation/conformance facts without importing ordinary names. V1 imports use ordinary namespace and visibility rules.

Summary

Catalyst should eventually decide whether a module can import only impls or conformance facts from another namespace.

V1 implementation visibility follows ordinary imports and public impl declarations.

Example

Possible future shape:

import impls module("json-adapters")

const text = std.fmt.format(user)

The imported module would make conformances visible without importing helper names into ordinary lookup.

Motivation

Impl-only imports could make adapter modules cleaner by exposing conformances without bringing helper names into local lookup. They also affect coherence, ambiguity, re-export, and diagnostics.

Proposed Direction

The proposal should cover:

  • source syntax for impl-only imports;
  • whether imported impls can be re-exported;
  • interaction with conformance visibility and ambiguity;
  • diagnostics when two adapter modules provide competing impls;
  • tooling display for visible impl sources.

V1 Compatibility

V1 imports are ordinary namespace operations. To expose a conformance as part of a module API, declare a pub impl in the exporting namespace.