Skip to content

feat: document companion type lifting#313

Merged
magnus-madsen merged 2 commits intomasterfrom
companion-modules-update
Apr 27, 2026
Merged

feat: document companion type lifting#313
magnus-madsen merged 2 commits intomasterfrom
companion-modules-update

Conversation

@magnus-madsen
Copy link
Copy Markdown
Member

@magnus-madsen magnus-madsen commented Apr 26, 2026

Summary

  • Rewrites src/companion-modules.md to reflect the new convention from feat: companion lifting flix#12518: companions are declared inside a module of the same name and must be the first declaration. Extends coverage from enum/trait to enum, struct, effect, and trait. Adds a section on placing instances in a type's companion module.
  • Adds a "Companions Go Inside the Module" section to src/for-llms.md so generated code uses the new style instead of the older sibling form.

Test plan

  • Build the book locally and skim the rendered Companion Modules page
  • Verify the for-llms section renders with the same ❌/✅ structure as the surrounding sections

🤖 Generated with Claude Code

magnus-madsen and others added 2 commits April 26, 2026 15:34
Update the companion modules page to reflect the new style introduced in
flix/flix#12518: companions are declared inside a module of the same name,
must be the first declaration, and may be enums, structs, effects, or traits.
Also document field visibility for struct companions and instance placement
in companion modules. Add a corresponding section to for-llms.md so generated
code uses the new style.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Update all struct examples in structs.md to declare each struct inside
a module of the same name (its companion), matching the convention
documented in companion-modules.md.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@magnus-madsen magnus-madsen merged commit 9d95756 into master Apr 27, 2026
1 check passed
@magnus-madsen magnus-madsen deleted the companion-modules-update branch April 27, 2026 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant