typelevel / shapeless-3

Generic programming for Scala
189 stars 22 forks source link

Add K21 test example with BifunctorK type class #224

Closed joroKr21 closed 2 months ago

joroKr21 commented 5 months ago

Followup to #221

joroKr21 commented 5 months ago

@milessabin I'm not sure if we would actually want to add this to the library or just close it as an experiment

milessabin commented 5 months ago

If you have an actual use for it, then I don't see any objection to adding it, other than footprint.

This is all basically boilerplate ... could code gen be used? Then split an arbitrary number of kinds out into separate modules?

joroKr21 commented 5 months ago

If you have an actual use for it, then I don't see any objection to adding it, other than footprint.

The only use-case I can think of is in cats-tagless for https://github.com/typelevel/cats-tagless/issues/261 + https://github.com/typelevel/cats-tagless/issues/29

This is all basically boilerplate ... could code gen be used?

I think that would be the only option yeah. I don't think macros or macro annotations can work currently.

Then split an arbitrary number of kinds out into separate modules?

Do you mean like ship the boilerplate generator? As like an sbt plugin? That would be an interesting idea.

milessabin commented 5 months ago

Do you mean like ship the boilerplate generator? As like an sbt plugin?

I didn't actually mean that, but it is an interesting idea!