ghostwheel

Hassle-free clojure.spec, automatic generative testing, side effect detection, and evaluation tracing for Clojure(-Script) ā€“ https://github.com/gnl/ghostwheel
genekim 2019-06-19T19:23:49.014700Z

@clojurians.net Iā€™m so excited to see all the discussions here on Ghostwheel! Iā€™m hoping people are finding your work as valuable and indispensable as me! :) Argh. I can't remember if I asked this already -- sorry if I did. (darned lack of searching on this Slack instance! :). I will submit PR with doc update this time. :) Is there any way to use Ghostwheel typing conventions for anonymous functions? I'm finding myself using the :pre to check arguments for Re-Frame event handlers. They look something like this, where anonymous event handling functions are associated with events. Thank you!!!

gnl 2019-06-20T20:43:44.023300Z

Hey @genekim, I vaguely remember having a conversation about this and I think it might have been with you. šŸ™‚ My suggestion then was the same as it is now, which is not to use anonymous functions:

(defn event-handler [_ _] ...)
(rf/reg-event-db :initialize event-handler)

genekim 2019-06-20T20:57:49.025100Z

Ah yes! @clojurians.net I'll record this and put in PR, so I don't ask a third time! :)

šŸ‘ 1
šŸ˜ 1
wilkerlucio 2019-06-19T20:01:23.015700Z

I think (if possible) to have instrumented annonimous fns would be nice, (>fn [x] [int? => int?] ...) šŸ™‚

šŸ¤Æ 1
gnl 2019-06-20T20:49:28.023600Z

Since Ghostwheel is simply using the existing clojure.spec APIs and to my knowledge they don't let you do instrumentation on anonymous functions, doing it that way isn't really possible at the moment. I think it shouldn't be too hard to implement actually, but it's still adding complexity which I'm not entirely convinced is worth it. I feel the cases where you'd need that you might as well create a top-level function, spec that and call it instead of the anonymous function.

šŸ‘ 2
wilkerlucio 2019-06-19T20:02:59.017100Z

and just like to say I'm loving ghostwheel, after proper setting up its great, but I feel like the default settings could be better, when I read the docs it makes me want all the instrumentation

gnl 2019-06-20T21:09:41.026900Z

Glad you're digging it, see below for my response to the other point. šŸ™‚

wilkerlucio 2019-06-19T20:03:21.017600Z

IMO would be better to have a lot of the instrumentation on by default (instrument, outstrument and expound), and then let the user disable what it doesn't want