typelevel / cats-tagless

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

Move in tagless related util from freestyle #3

Open kailuowang opened 6 years ago

kailuowang commented 6 years ago

@raulraja would you suggest anyone that could help with this?

raulraja commented 6 years ago

I'll ask the Freestyle team and someone will get to it. Thanks! This is exciting!

diesalbla commented 6 years ago

@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:

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.

kailuowang commented 6 years ago

@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?

diesalbla commented 6 years ago

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.

kailuowang commented 6 years ago

Makes sense. @diesalbla. I vote let's add the two.

kailuowang commented 6 years ago

@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?

raulraja commented 6 years ago

@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.

kailuowang commented 6 years ago

got it, Thanks @raulraja. I'll try get the initial release out of the door soon.