-
Notifications
You must be signed in to change notification settings - Fork 0
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
Use typeclasses for decoding input types #5
Comments
Now that I think about it. Returning |
A decent idea is to define a decoder as trait Decoder[-I, O]:
def decide(I: I): O Then we can summon Then based on the Not sure how to handle dropdowns with this encoding though. Maybe the e.g. trait Decoder[O]:
type I <: InputType
def decide(I: InType[I]): O (This might have to be on the term level) |
One implementation detail for implementing this is that the generated code should change the eithers into exceptions, apply the function to the arguments extracted from the eithers and optionally catch the exceptions. |
Add decoders for fields, so that we don't have to hardcode generation logic in the macro code
String -> Either[String, A]
sounds good, but we want to support more than just text fields 🤔So the type class should provide both the type of the field and the decoder, but how to make it type safe?
The text was updated successfully, but these errors were encountered: