3 ms·
This talk mentions other reasons for the move away from the magrittr pipe, apparently it was very difficult to debug: https://www.youtube.com/watch?v=X_eDHNVceC
by nomilk 3y ago
This talk mentions other reasons for the move away from the magrittr pipe, apparently it was very difficult to debug: https://www.youtube.com/watch?v=X_eDHNVceCU&t=1h08m33s https://www.youtube.com/watch?v=X_eDHNVceCU&t=1h08m33s
- jgalt212 3y agoall functional languages are difficult to debug. y = h(f(g(x))) where do you put the print statements or loggers?
- bradrn 3y agoIn Haskell, you put it in the pipeline: for instance, y = h (f (traceShowId (g x))) (Haskell is normally pure, but these functions from Debug.Trace are a notable exception.)
- jonnylaw 3y agoYou use a tee https://en.wikipedia.org/wiki/Tee_(command) https://en.wikipedia.org/wiki/Tee_(command)
- jgalt212 3y agoooh, that's useful. thanks.
- mtreis86 3y agoIn Common Lisp you put the print statement inline, it will return the result of the form you pass it so it doesn't change the results. If you want to know what f is returning in the form (h (f (g x))) you'd (h (print (f (g x)))) and it will print what f returns to the repl. Or use Stickers provided by Sly which sort of log things as they change. https://joaotavora.github.io/sly/#Stickers https://joaotavora.github.io/sly/#Stickers In that case you'd highlight the form starting at f, and turn a sticker on. Then run the code, sticker outputs into a window.