Open
Conversation
Added `makeComponentTags` in `Apecs.TH` to fold component types into an enum of tags as requested. It takes a string for the enum name and a list of component types, and generates a data declaration where the constructors are the component names prefixed with `T`. Also added the generation test to the `WorldEnumerable` scenario in `apecs/test/Main.hs`. Co-authored-by: dpwiz <486682+dpwiz@users.noreply.github.com>
Co-authored-by: dpwiz <486682+dpwiz@users.noreply.github.com>
Also clean up some of the tag/sum mess. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Extra utilities to collect and introspect "everything". Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
…#11) Co-authored-by: dpwiz <486682+dpwiz@users.noreply.github.com> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
…Components` Generates a function that counts how many entities have each enumerable component type, returning `[(tag, Int)]`. Filters by `ExplMembers` so Global/ReadOnly stores are excluded. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…etypes A plain utility function (not TH-generated) that takes a member set and a tag-getter function, groups entities by their tag combination using IntSet as a compact intermediate, and returns Map (Set tag) Int. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Follows the same pattern as `Has w m c` — the world type `w` dispatches to the tag system generated by `makeTaggedComponents`. This enables generic utilities that work in `SystemT w m` without naming world-specific types like `getWorldTags`. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extract `WTag` as a standalone type family and add `m` parameter to `HasTags w m`, mirroring the existing `Has w m c` pattern. This allows `HasTags` to work with apecs-stm (STM) or pure test monads instead of being hardcoded to IO. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This allows types like
Map Entity (Map WorldTag WorldSum)andIntMap (IntMap a)for #146The story so far (an excerpt from my patched shmup used to