-
Notifications
You must be signed in to change notification settings - Fork 70
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
Conversation
c3903b5
to
ae72f43
Compare
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.
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) |
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.
* fooOption = foo.transform(toList) | |
* val fooList: Foo[List] = foo.transform(toList) |
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.
} | ||
|
||
/** | ||
* A transformation that turns a bifunctor algebra into a monofunctor algebra by lifting absorbing known errors in a |
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.
* 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 |
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 the path is a directory, we get the hashes of all files | ||
// then hash the concatenation of the hash's bytes. |
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.
this looks too familiar
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.
That's because it's also in the SBT plugin built by this project.
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.
Yep
message: String | ||
} | ||
} | ||
```scala mdoc:passthrough |
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.
TIL
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.WithError
type alias.Transformation.AbsorbError
andTransformation.SurfaceError
+ tests . This will help EitherT/MonixBIO/ZIO users.