malli

https://github.com/metosin/malli :malli:
schmee 2020-10-09T00:06:25.061300Z

@mac the equivalent is [:enum ...]

2020-10-09T06:38:58.062200Z

@schmee Ah, thanks.

ikitommi 2020-10-09T06:49:02.062400Z

thanks!

ikitommi 2020-10-09T06:55:54.068Z

@dharrigan could have been a non-alpha, but was busy getting it out, so just alpha now. Grand goal is to get 1.0.0 out as soon as possible, after the final pieces (sequences, parsing, functions, default options) have been implemented, might effect the public api so that need to bump MAJOR. Most likely something that is easily migrated from pre-1.0.0.

ikitommi 2020-10-09T07:00:51.073100Z

@mac there is a special type-schemas mechanism which would allow using using plain sets, but having too much shortcuts might make things harder to understand. There is already a such type shortcut for regexs, not sure if that was the right call:

#"\d+kikka"        ;; using the type-shortcut
[:re #"\d+kikka"]  ;; explicit
sets - besides :enum, there is :fn for any function.
[:enum "a" "b" "c"]
[:fn #{"a" "b" "c"}]
:enum doesn’t do type inferring atm, so you can hint the type so that JSON Schema, value transformation etc. work correctly:
[:and keyword? [:enum :kikka :kukka]]

dharrigan 2020-10-09T07:02:25.073800Z

@ikitommi fantastic! Thank you for the update (and also the libraries, reitit and malli - super awesome sauce!)

2020-10-09T07:23:41.074700Z

@ikitommi Thanks, the reg-ex shortcut looks pretty idiomatic to me.

borkdude 2020-10-09T09:09:57.075100Z

Are there any libs like cli-matic that use malli instead of spec for arg parsing/validation?

2020-10-09T12:18:20.076800Z

Today was supposed to be ClojuTRE 2020, but what we got was t-shirts with malli validation errors. Just put these fun little items to Metosin shop: https://shop.spreadshirt.net/metosin/

Lucas Félix 2020-10-09T17:57:30.078700Z

hi! - sorry for my english - is there something like spec functions (https://clojure.org/guides/spec#_specing_functions) in malli? if not, what’s the motivation?

Lucas Félix 2020-10-09T18:24:27.080Z

thanks! @borkdude

steveb8n 2020-10-09T22:56:52.082Z

@ikitommi I’m curious why you’ve stopped mentioning the multi-tenant validation capabilities of Malli. for me, this was the original reason for using it and the registry design is very well done