typelevel / cats-tagless

Library of utilities for tagless final encoded algebras
https://typelevel.org/cats-tagless/
Apache License 2.0
310 stars 41 forks source link

Auto derive Scala 3 macro for ReaderT #557

Closed alonsodomin closed 2 days ago

alonsodomin commented 1 week ago

Initial implementation of a macro for auto-derivation of algebras based on ReaderT, which results useful to transform side-effecting algebra implementations into algebras using cats-effect IO.

The implementation holds some duplication in relation to the common code found in DeriveMacros utility extensions. It's been left in the macro implementation because, even though there are some commonalities, the derivation of ReaderT has its own peculiarities that may not be worth a refactor on the common utilities. Up to discussion, obviously.

alonsodomin commented 1 day ago

thanks @joroKr21, looks much cleaner like this.