Open kailuowang opened 6 years ago
I'll ask the Freestyle team and someone will get to it. Thanks! This is exciting!
@kailuowang In the title tagless related util from freestyle, which components of freestyle
should be ported to cats-tagless
?
Porting the macros should not be difficult, since they are written on scalameta
. On the side of the macros, in the freestyle-core
, the main elements I can see are the following:
@tagless
macro, to generate complementary parts of the F-algebra. Note that the macro generates an F[_]
parameter (if missing), the apply
method in the companion object, and the mapK
function.@tagless
macro, to generate a Free
-based default encoding for the algebra. Note that this only adds the ADT of operations, and is not tied to the Free-FreeApplicative
encoding. @module
macro, for combining algebras using implicit parameters.Regarding the integrations, some of those integrations are now overlapping with existing type-classes in cats
or cats-effect
. Other integrations provide functionality which is now available in other libraries.
@diesalbla thank you for looking into this. I think the @tagless
macro to generate complementary parts (Apply
and mapK
) overlaps with existing ones already ported in.
The generation of ADT of operations sounds a good one to be ported in.
@module
looks nice too. BTW just curious can you add more methods to a @module
trait?
Regarding the @module
macro, the annotated trait or abstract class can have other concrete values and methods. It can also have concrete methods of type F[A]
, where F[_]
is the parameter of the F-algebra
, which you can use to combine the operations of the combined algebras. The macro works by taking any deferred val
to be a reference to an algebra.
The generation of ADT operations is one of the things that the @free
macro does. It has some restrictions on the form of the annotated traits, which @tagless
does not have. For instance, whereas an @tagless
-annotated trait can have type parameters, the stack-safe does not support that.
Makes sense. @diesalbla. I vote let's add the two.
@diesalbla not to rush you by any means. Just wonder how we shall schedule our first release. Shall we do one release now or you think this one is imminent enough to hold it for?
@kailuowang @diesalbla Not sure if you agree but for what we are concerned at Freestyle and 47 Degrees as users we are eager to start using cats-tagless
and we can probably include those Freestyle related features in the next version of cats-tagless. I don't think we should hold the release for those features and they can always make a nice set of improvements and features in the next version.
got it, Thanks @raulraja. I'll try get the initial release out of the door soon.
@raulraja would you suggest anyone that could help with this?