Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add methods arity and foldLeft0 #261

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

eejbyfeldt
Copy link

@eejbyfeldt eejbyfeldt commented Jan 23, 2025

I am not sure foldLeft0 is the perfect or desired interface. But I am opening this PR to show that (at least to my understanding) a TypeClass like ShowType can not be implemented in the current interface.

Of course one can argue that the traversal in ShowType should be done at compile time since it does not depend on any runtime values. But I have a use case where I want to have a type class that need to traverse the elements in multiple ways and being able to implement all of them using the shapeless 3 API would be useful.

I am not sure foldLeft0 is the perfect or desired interface. But I am
opening this PR to show that (at least to my understanding) a TypeClass
like ShowType can not be implemented in the current interface.

Of course one can argue that the traversal in ShowType should be done at
compile time since it does not depend on any runtime types. But I have a
use case where I want to have a type class that need to traverse the
elements in multiple ways and being able to implement all of them using
the shapeless 3 API would be useful.
@joroKr21
Copy link
Member

I can see the reasoning, why not. I thought internals are ignored by MiMa, need to check

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.

2 participants