-
Notifications
You must be signed in to change notification settings - Fork 77
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
Add apply
for F[_] services
#16
Conversation
I'd rather not merge it as is : I'd like for the Any idea how we could solve it differently ? |
We could possibly do it like CE does, and come up with a bunch of I don't think the |
@@ -4,11 +4,26 @@ package object example { | |||
val NAMESPACE: String = "smithy4s.example" | |||
|
|||
type StreamedObjects[F[_]] = smithy4s.Monadic[StreamedObjectsGen, F] | |||
val StreamedObjects : smithy4s.Service[StreamedObjectsGen, StreamedObjectsOperation] = StreamedObjectsGen | |||
object StreamedObjects extends smithy4s.Service.Provider[StreamedObjectsGen, StreamedObjectsOperation] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think turning it into an object might help metals ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed, it should help autoimport!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aaaaaand it does.
@kubukoz when you have time, would you mind trying this encoding in your project ? |
@@ -47,12 +48,16 @@ trait Service[Alg[_[_, _, _, _, _]], Op[_, _, _, _, _]] extends Transformable[Al | |||
|
|||
def transform[P[_, _, _, _, _]](transformation: Transformation[Op, P]): Alg[P] | |||
|
|||
def asTransformation[F[_]](impl: Monadic[Alg, F]): Interpreter[Op, F] = asTransformationGen[GenLift[F]#λ](impl) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're gonna break compat and bump minor, I want to remove this one which is biased towards F[_]
kinds. Ideally, I want the bias to be centralised in the package object, so that we can easily offer some customisability there without impacting the main code generation template.
Works like a charm :) |
Creates a `Service.Provider` interface and use that in places, to increase flexibility and convenience of type aliases to generated services Co-authored-by: Olivier Mélois <[email protected]>
No description provided.