Skip to content

Add methods arity and foldLeft0#261

Merged
joroKr21 merged 3 commits intotypelevel:mainfrom
eejbyfeldt:add-arity-and-foldLeft0
Feb 26, 2025
Merged

Add methods arity and foldLeft0#261
joroKr21 merged 3 commits intotypelevel:mainfrom
eejbyfeldt:add-arity-and-foldLeft0

Conversation

@eejbyfeldt
Copy link
Contributor

@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

@joroKr21 joroKr21 merged commit b3ea897 into typelevel:main Feb 26, 2025
6 checks passed
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