You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Idiomatic Scala doesn't use null, so it'd be nice for there to be an easy way to guarantee that all the fields of a validated record are non-null without boiler plate field1 is notNull, field2 is notNull, etc.
The text was updated successfully, but these errors were encountered:
While you can always implement a validator yourself, from a core library perspective this doesn't seem compelling (I can think of a couple of counter-arguments); implementing this with reflection goes against the grain of Accord, and a typesafe solution is too much work just for this feature.
Then again, perhaps an "iterator-style" modifier on fields? Then you can do something like p.fields.each is notNull, which might be an interesting exercise in using Shapeless (CCing @noam-almog :-)).
I agree with both avoiding reflection and that a type safe solution would be tricky, which doesn't leave a lot to work with I guess. The Shapeless solution looks good though, if it's not too much trouble.
Idiomatic Scala doesn't use null, so it'd be nice for there to be an easy way to guarantee that all the fields of a validated record are non-null without boiler plate
field1 is notNull
,field2 is notNull
, etc.The text was updated successfully, but these errors were encountered: