purescript-debug
purescript-debug copied to clipboard
Add spyM
I feel like this is actually the most useful one. So it's even more surprising that it's missing 😅
spyM :: forall m a. DebugWarning => Monad m => String -> a -> m Unit
The spy functions are meant for inserting into the midst of an expression such that you don't have to break it up to observe some value passing through it - so this would be a trace, I guess it's the tag/label argument you want?
I usually do traceM { label: value } for that kind of thing. 🙂
Yeah right, it's probably closer to trace. Yes I'm missing the label!
Ok sure, that works too I guess. Although I'm not sure about its discoverability and if you want to tell beginners that this is the canonical way 😅 Let's at least mention it in the docs?