Fork me on GitHub

I have a map that contains function values, but I want to use a Var (`#'function-name`) to facilitate repl-driven development, however fn? doesn’t consider the Var a function and malli doesn’t recognize var? as a schema function

Ben Sless20:01:56

You want to validate the map itself?


I have the validation for the map, but i’m realizing I need to be able to say [:or fn? var?] instead of just fn?

Ben Sless20:01:58

You can use a decoder

Ben Sless20:01:10

And deref the values :)

Ben Sless20:01:14

I.e. [:map [:k [fn? {:decode/var deref}]]]

Ben Sless20:01:18



huh interesting. i’ll give that a shot! thanks

Ben Sless20:01:04

Cheers. Make sure to wrap that deref in a try catch

Ben Sless20:01:59

But, why are you validating a map of functions? Especially w/o function schema it isn't very informative, is it?


just barebones checking that i’m creating the right types, not doing much more than that to start


any way to handle this?