malli

cfleming 2024-09-15T21:17:48.643599Z

Hi Malli folk! For those of you using Cursive, after a productive plane journey the next version will allow you to return custom tree nodes from the REPL, which (among many other useful things) allows pretty, explorable Malli errors right in the seeker - edited to put the screenshots in the thread:

๐Ÿ™ 2
๐Ÿคฉ 1
๐ŸŽ‰ 1
steveb8n 2024-09-19T02:47:59.480419Z

Iโ€™m using both stdout/pretty and Seeker and trying to figure out ways in which Seeker can be better than the colorised pretty reporter. Looking forward to clarifying so I know if/when Seeker is the better option. Curious to know how you both would describe the difference/improvements when using Seeker. maybe a demo video when itโ€™s good enough?

cfleming 2024-09-19T04:17:00.707319Z

Yes, a demo video is definitely a great idea.

avocade 2024-09-16T10:13:18.926419Z

nice!

cfleming 2024-09-16T14:30:13.894599Z

@ikitommi one thing that would help would be examples of ways to generate all the different types of exceptions. I have the obvious ones from the doc, I couldn't find examples of e.g. m/register-function-schema in the doc (or the tests ๐Ÿ˜‡ )

ikitommi 2024-09-16T14:46:02.222509Z

@cfleming what if there was a intermediate step in prettifying: exception -> prepocessed data. And two different printers for that: malli.dev.pretty and Cursive? Could that work? Would it make any sense?

ikitommi 2024-09-16T14:46:52.665399Z

e.g. split the current pretty into 2 steps so the preprocessing could be reused (and always up-to-date for new exceptions for Cursive)

cfleming 2024-09-16T14:51:25.200219Z

Could be, although there's not that much pre-processing on top of what pretty already does. Let me get a gist up of what this currently looks like.

cfleming 2024-09-16T14:53:55.959929Z

There's a little bit of duplication there, since in pretty things like -errors and -explain take a printer, but it's not much. A lot of that is just some helper functions and the test comments to exercise it. @ikitommi are you going to Heart of Clojure? We could take a look at it there if so.

cfleming 2024-09-16T15:21:41.060009Z

Thinking about it, I think the best abstraction for these would be some kind of lightweight document format, as you suggest. Then those could be processed by Cursive or Pretty. I think that's the only way we could isolate them from future changes in the exception format.

ikitommi 2024-09-16T15:51:48.858569Z

I would love to be, but can't make it. Second โค๏ธ, second miss ๐Ÿ˜ž. Bunch of metosin2 s coming thou. Would you be interested in doing the lightweight document format PR?

cfleming 2024-09-17T02:56:32.591789Z

Definitely interested, but not sure how much time Iโ€™ll have in the next wee while. Iโ€™ll take a look when I have time though.

๐Ÿ‘ 1
cfleming 2024-09-15T21:20:19.016259Z

These are based on the existing dev pretty logic, I don't have them all done yet but most of the common ones.

ikitommi 2024-09-16T05:36:01.769529Z

wow. thatโ€™s really cool. If there is something that can help your work on malli side, please share, happy to help!