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

Add error-related transformations + documentation #584

Merged
merged 11 commits into from
Nov 10, 2022

Conversation

Baccata
Copy link
Contributor

@Baccata Baccata commented Nov 9, 2022

  • moves Transformation back to the main smithy4s package. I think it was a mistake for me to move it, and now the companion object contains constructs that could be more user-facing.
  • Adds the rendering of a WithError type alias.
  • Adds Transformation.AbsorbError and Transformation.SurfaceError + tests . This will help EitherT/MonixBIO/ZIO users.
  • Adds a function to the docs module to the content of the smithy files into the documentation. This should help avoid things falling out of sync.
  • Adds documentation on transformations.

@Baccata Baccata force-pushed the transformation-documentation branch from c3903b5 to ae72f43 Compare November 9, 2022 16:04
Copy link
Contributor

@lewisjkl lewisjkl left a comment

Choose a reason for hiding this comment

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

Awesome, love the docs!

* // assuming Foo is a code-generated interface
* val fooOption : Foo[Option] = ???
* val toList = new smithy4s.PolyFunction[Option, List]{def apply[A](fa: Option[A]): List[A] = fa.toList}
* fooOption = foo.transform(toList)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* fooOption = foo.transform(toList)
* val fooList: Foo[List] = foo.transform(toList)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

}

/**
* A transformation that turns a bifunctor algebra into a monofunctor algebra by lifting absorbing known errors in a
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* A transformation that turns a bifunctor algebra into a monofunctor algebra by lifting absorbing known errors in a
* A transformation that turns a bifunctor algebra into a monofunctor algebra by absorbing known errors in a

Copy link
Contributor Author

Choose a reason for hiding this comment

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

kubukoz
kubukoz previously requested changes Nov 9, 2022
Comment on lines +1000 to +1001
// If the path is a directory, we get the hashes of all files
// then hash the concatenation of the hash's bytes.
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 too familiar

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's because it's also in the SBT plugin built by this project.

Copy link
Member

Choose a reason for hiding this comment

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

Yep

message: String
}
}
```scala mdoc:passthrough
Copy link
Member

Choose a reason for hiding this comment

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

TIL

modules/docs/markdown/06-guides/extract-request-info.md Outdated Show resolved Hide resolved
modules/docs/markdown/06-guides/transformations.md Outdated Show resolved Hide resolved
@Baccata Baccata dismissed kubukoz’s stale review November 10, 2022 15:19

comments were addressed

@Baccata Baccata merged commit ef44cde into series/0.17 Nov 10, 2022
@Baccata Baccata deleted the transformation-documentation branch November 10, 2022 16:53
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.

4 participants