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
In my experience, it is quite common having a schema that is valid for most cases but once in a while, would need some change in properties, like altering :min / :max values or generation with :gen/fmap. Hence, the following would be a very convenient way of quickly reusing a schema like so:
@ikitommi was asking if modifying children was acceptable or not. I would suggest not. Modifying properties usually do not alter the deeper meaning of the schema itself, whereas altering children typically does:
In contrast, altering only properties is fairly uncontroversial. By altering, I mean merging given ones with the original ones. I would make a great use of such a feature, do you think other users would as well?
To consider: perf cost, suppose I add another indirection by "extending" :small-int-vec, and yet another one on top of that one, that will be a lot of indirection to resolve. There is a balance to maintain between convenience and performance.
The text was updated successfully, but these errors were encountered:
I agree, it sort of 'feels' more natural this way, 'extending' schemas in terms of others. We're using malli more like spec (attr-oriented, mutable registry, etc), enhanced with our own custom properties, and this would be really useful
(Originally mentioned on Slack)
In my experience, it is quite common having a schema that is valid for most cases but once in a while, would need some change in properties, like altering
:min
/:max
values or generation with:gen/fmap
. Hence, the following would be a very convenient way of quickly reusing a schema like so:@ikitommi was asking if modifying children was acceptable or not. I would suggest not. Modifying properties usually do not alter the deeper meaning of the schema itself, whereas altering children typically does:
In contrast, altering only properties is fairly uncontroversial. By altering, I mean merging given ones with the original ones. I would make a great use of such a feature, do you think other users would as well?
To consider: perf cost, suppose I add another indirection by "extending"
:small-int-vec
, and yet another one on top of that one, that will be a lot of indirection to resolve. There is a balance to maintain between convenience and performance.The text was updated successfully, but these errors were encountered: