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

Sequence/regex schemas #180

Closed
ikitommi opened this issue Feb 17, 2020 · 4 comments
Closed

Sequence/regex schemas #180

ikitommi opened this issue Feb 17, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@ikitommi
Copy link
Member

ikitommi commented Feb 17, 2020

From slack:

like clojure.spec.alpha/conform, there could be something for that? Explain could return either failures or real values if no errors exist.

 (->
   [:cat
    [:x int?]
    [:y int?]
    [:rest [:* string?]]]
   [1 2 "kikka" "kukka"]
  (m/explain)
  (mu/humanize))
 ; {:x 1
 ;  :y 2
 ;  :rest ("kikka "kukka")}

and/or, an anonymous variant:

 (m/valid?
   [:cat int? int? [:* string?]]
   [1 2 "kikka" "kukka"])
 ; => true

using for example https://github.com/cgrand/seqexp under the hoods

@ikitommi ikitommi added enhancement New feature or request for discussion Discussion is main focus of PR labels Feb 21, 2020
@green-coder
Copy link
Member

green-coder commented Feb 29, 2020

When designing it, the scenario of implementing the equivalent of clojure.alpha.spec/unform might also be considered.

For info, I would use both conform and unform if malli has it.

@ikitommi
Copy link
Member Author

@ikitommi
Copy link
Member Author

Initial internal impl done, just 123loc. need to add tests and figure out how to expose the parsing api in general.

Screenshot 2020-09-10 at 20 41 31

@ikitommi ikitommi added Clojurists Together Sponsored by Clojurists Together Q3 2020 and removed for discussion Discussion is main focus of PR labels Sep 10, 2020
@ikitommi ikitommi removed the Clojurists Together Sponsored by Clojurists Together Q3 2020 label Nov 29, 2020
@ikitommi
Copy link
Member Author

Master!

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