Skip to content

Add a Rep type function for Generic#908

Merged
quark17 merged 2 commits intoB-Lang-org:mainfrom
krame505:generic-rep-type-fun
Apr 18, 2026
Merged

Add a Rep type function for Generic#908
quark17 merged 2 commits intoB-Lang-org:mainfrom
krame505:generic-rep-type-fun

Conversation

@krame505
Copy link
Copy Markdown
Collaborator

@krame505 krame505 commented Apr 10, 2026

This adds a Rep type function, which IMO makes generics-based typeclass implementations easier to read. The name matches the Rep type family used in Haskell's GHC.Generics library.

We should probably also add type functions for some of the port-splitting-related utilities, but I will do that in a future PR to avoid merge conflicts with #849.

@quark17 quark17 merged commit e7d44bf into B-Lang-org:main Apr 18, 2026
79 checks passed
@nanavati
Copy link
Copy Markdown
Collaborator

@krame505 Looking at this PR it seems we do permit type functions in matching position, they just have to be treated as a variable, typically catch all instances? Was that an intended change or am I misreading the code?

@nanavati
Copy link
Copy Markdown
Collaborator

Never mind. I looked more closely and realized the type functions were only in contexts and determined positions. So there's actually no issue.

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.

3 participants