malli

https://github.com/metosin/malli :malli:
kwrooijen 2021-02-08T07:10:07.069300Z

How do you spec a function? e.g. I'd like to do this:

[:map
 [:component/foo 'fn?]]

kwrooijen 2021-02-08T07:10:30.069600Z

But that results in :malli.core/invalid-schema {:schema fn?}

ikitommi 2021-02-08T07:14:23.070700Z

@kevin.van.rooijen you can say: [:map [:component/foo [:fn fn?]] or 'fn? to keep it serializable

ikitommi 2021-02-08T07:15:19.071800Z

my code sniplet from yesterday show how one can enforce input & output params and arities too.

ikitommi 2021-02-08T07:16:25.071900Z

this @kevin.van.rooijen, in master, will be released soon.

kwrooijen 2021-02-08T07:20:00.072700Z

Cool, [:fn 'fn] works like a charm

kwrooijen 2021-02-08T07:20:20.073200Z

Thanks, looking forward to the next release 🙂 Will be replacing all my specs with Malli once that happens

ikitommi 2021-02-08T13:41:06.075700Z

nice. would be great if some non-metosinian blogged about the goods and bads of spec, schema and malli - from real life experience. happy to try fix all the bads in malli 😉

kwrooijen 2021-02-08T20:01:35.076400Z

I might do that eventually, although I have a hard time thinking of bad things about Malli, so it'll probably only be success stories 🙂

kwrooijen 2021-02-08T20:03:10.077700Z

I'm currently using it for Gungnir, and working on integrating it for Duct / some web development stuff. At my job we heavily use Malli as well (As well as serialized through an API)

kwrooijen 2021-02-08T20:04:29.078700Z

I might use the new parser for a (hiccup) templating language that I'm building. So that's pretty cool timing of the new feature 😄