How do you spec a function? e.g. I'd like to do this:
[:map
[:component/foo 'fn?]]
But that results in :malli.core/invalid-schema {:schema fn?}
@kevin.van.rooijen you can say: [:map [:component/foo [:fn fn?]]
or 'fn?
to keep it serializable
my code sniplet from yesterday show how one can enforce input & output params and arities too.
this @kevin.van.rooijen, in master, will be released soon.
Cool, [:fn 'fn]
works like a charm
Thanks, looking forward to the next release 🙂 Will be replacing all my specs with Malli once that happens
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 😉
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 🙂
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)
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 😄