malli

https://github.com/metosin/malli :malli:
ikitommi 2021-03-26T08:11:36.232400Z

ping @raymcdermott

1
raymcdermott 2021-03-26T16:20:58.232600Z

I thought it read 5k loc ... so 😅

raymcdermott 2021-03-26T16:21:15.232800Z

I have added a quick comment. Thanks for the feature

borkdude 2021-03-26T21:15:40.237500Z

I'm in the process of designing a task-executor DSL. Example: {:tasks {:clean [:shell "rm" "-rf" "target"]}} I want to be able to give a task a description and possibly more options. So I thought I can do: {:tasks {:clean [:shell {:task/description "foo"} "rm" "-rf" "target"]}} but this reads a bit weird, because I expect :shell to get shell-related options and not some general task options. One alternative I came up with:

{:tasks {:clean ^{:task/description "foo"} [:shell "rm" "-rf" "target"]}}
A bit ugly maybe, but semantically correct: the metadata is about the task. However, processing EDN with metadata, it can be done, but it might lead to confusion. The other alternative, an explicit :task wrapper if you want to provide options:
{:tasks {:clean [:task {:description "foo"} [:shell "rm" "-rf" "target"]]}}
I wonder if you came across similar problems when designing malli, I'd love to hear your feedback.

borkdude 2021-03-26T21:26:27.238Z

I think malli more or less ended up with:

{:tasks {:clean [:shell {:description "Clean all the things"} "rm" "-rf" "target"]}}
right?