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

More robust providers #74

Open
4 of 9 tasks
ikitommi opened this issue Sep 15, 2019 · 2 comments
Open
4 of 9 tasks

More robust providers #74

ikitommi opened this issue Sep 15, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@ikitommi
Copy link
Member

ikitommi commented Sep 15, 2019

The followings should be inferred, via options on threshold?

  • :maybe (would be easy if there was :nil type in the stats
  • :tuple (option + threshold)
  • :enum (option + threshold)
  • :or for values. e.g. [:or string? keyword? instead of some?
  • :min and :max on collections
  • :map-of
  • comparators for values
  • reusing schemas in both inferring and from registry
  • :multi

There should be a easy way to plug in custom user-land schemas like :counted (plug in custom code for both stats & schema generation)

@ikitommi ikitommi added the enhancement New feature or request label Sep 15, 2019
@stathissideris
Copy link

Some of the above would be possible by using the stats-gathering mechanism of spec-provider. As I am familiar with it, I could help integrate it an extend it to cover any cases that are currently not possible. Do you have any reasons for not adding a dependency to spec-provider?

@ikitommi
Copy link
Member Author

ikitommi commented Feb 1, 2020

Sorry for really long time to respond.

One of the key motivations in developing malli was the ability to optimize and refactor the whole, extra features like schema transformation, value generation and value inferring lean on the core and the core has evolved based on requirements of the extra features (new protocols, protocol methods, arguments to visitors etc). I would like to keep it that way.

The current inferring impl is naive and definitely needs lot of work for both stats collection and schema generation, but I would like it to be part of the library. Goal is also to be able to support custom user-defined schema inferring, like there is already extension mechanisms for value generation and schema transformation. Currently multimethods, will most likely add Protocols for those too.

Help on this would be much appreciated. Preference being that the inferring code would reside in malli and all the options would be coherent to the rest of the library, e.g.

{:malli.provider/multi-schema-dispatch {first :type}}.

Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants