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

smithy4s.Hints.Key => smithy4s.ShapeTag #85

Merged
merged 4 commits into from
Jan 28, 2022
Merged

smithy4s.Hints.Key => smithy4s.ShapeTag #85

merged 4 commits into from
Jan 28, 2022

Conversation

Baccata
Copy link
Contributor

@Baccata Baccata commented Jan 28, 2022

  • Extracts the hint key into its own called ShapeTag : it may not
    be used just for its hints anymore.
  • Creates a SchemaIndex that is a map of ShapeTag to Schema.
  • Updates the ProtocolInterface to be constructed with the SchemaIndex
    instead, which the HintMask is derived

This is gonna be tremendously useful for the Dynamic work

* Extracts the hint key into its own called ShapeTag : it may not
be used just for its thing.
* Creates a `SchemaIndex` that is a map of `ShapeTag` to `Schema`.
* Updates the ProtocolInterface to be constructed with the SchemaIndex
instead, which the HintMask is derived

This is gonna be tremendously useful for the Dynamic work
@@ -309,7 +309,7 @@ private[codegen] class Renderer(compilationUnit: CompilationUnit) { self =>
block(
s"implicit val protocol: smithy4s.Protocol[$name] = new smithy4s.Protocol[$name]"
) {
s"def hintMask: smithy4s.HintMask = smithy4s.HintMask($protocolTraits)"
s"def schemas: smithy4s.SchemaIndex = smithy4s.SchemaIndex($protocolTraits)"
Copy link
Member

Choose a reason for hiding this comment

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

this looks very promising in general

def withHints[A](fa: F[A], hints: Hints): F[A]
}

private[smithy4s] class Impl(
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
private[smithy4s] class Impl(
private[smithy4s] final class Impl(

Copy link
Contributor Author

Choose a reason for hiding this comment

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

case class Binding[A](key: Key[A], value: A) {
def tuple: (Key[A], Binding[A]) = key -> this
case class Binding[A](key: ShapeTag[A], value: A) {
def tuple: (ShapeTag[A], Binding[A]) = key -> this
Copy link
Member

Choose a reason for hiding this comment

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

if you wanna be fancy... does this work?

Suggested change
def tuple: (ShapeTag[A], Binding[A]) = key -> this
def tuple: (ShapeTag[A], this.type) = key -> this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Baccata Baccata merged commit b81d9ad into main Jan 28, 2022
@Baccata Baccata deleted the schema-indexes branch January 28, 2022 21:35
Baccata added a commit that referenced this pull request May 10, 2022
* Extracts the hint key into its own called ShapeTag : it may not
be used just for its hints anymore.
* Creates a `SchemaIndex` that is a map of `ShapeTag` to `Schema`.
* Updates the ProtocolInterface to be constructed with the SchemaIndex
instead, which the HintMask is derived

This is gonna be tremendously useful for the Dynamic work
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants