Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace all occurrences of @tagless annotation with the manual impl #296

Merged
merged 3 commits into from Jun 4, 2018

Conversation

pepegar
Copy link
Member

@pepegar pepegar commented Jun 4, 2018

Currently, most of the implementaitions only needed the Handler[F]
type in the companion.
Not even that :)

FIXES #292

Currently, most of the implementaitions only needed the `Handler[F]`
type in the companion.
@juanpedromoreno juanpedromoreno added this to In progress in Freestyle RPC Jun 4, 2018

object GrpcServer {

trait Handler[G[_]] extends GrpcServer[G]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the @tagless macro of freestyle, the Handler alias is useful only if you use the stacksafe option, in which case the Handler is both the algebra and an interpreter (natural transformation) from the Op type, used in the free algebra.

If you do not use the Op classes, or a Free encoding, you can get rid of the Handler, since it adds nothing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thanks for the tip! Changing it


object TodoListClient {
trait Handler[G[_]] extends TodoListClient[G]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as in my other comment.


object TodoItemClient {
trait Handler[G[_]] extends TodoItemClient[G]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as in my other comment.

@@ -36,3 +34,7 @@ trait TagClient[F[_]] {
def remove(id: Int): F[Int]

}

object TagClient {
trait Handler[G[_]] extends TagClient[G]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as here.

trait PingPongClient[F[_]] {
def ping(): F[Unit]
}

object PingPongClient {
trait Handler[G[_]] extends PingPongClient[G]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as here.

trait RouteGuideClient[F[_]] {
def getFeature(lat: Int, lon: Int): F[Unit]
def listFeatures(lowLat: Int, lowLon: Int, hiLat: Int, hiLon: Int): F[Unit]
def recordRoute(features: List[Feature], numPoints: Int): F[Unit]
def routeChat: F[Unit]
}

object RouteGuideClient {
trait Handler[G[_]] extends RouteGuideClient[G]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as here.

@@ -165,6 +163,14 @@ object Utils extends CommonUtils {
def bsws(eList: List[E]): F[E]
}

object MyRPCClient {

trait Handler[G[_]] extends MyRPCClient[G]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as here.

@pepegar pepegar merged commit 6c2c4cf into master Jun 4, 2018
Freestyle RPC automation moved this from In progress to Done Jun 4, 2018
@juanpedromoreno juanpedromoreno deleted the ppg/replace-tagless-with-manual-impl branch June 7, 2018 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Freestyle RPC
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants