by joel_ms · 7y ago · 0 comments
You've basically reimplemented Haskell's Debug.Trace[0] :)
The difference is of course that Haskell doesn't really have statements in the same way that C# does, so in Haskell it's nescessary to turn the log/trace-function into an identity function after you've applied the message-string.
I agree that it is ugly, and in any serious project I would use a proper logging setup, but I almost feel like the ugliness is a feature not a bug. It's like an extra cost when doing debug-by-print, which at least seem to keep me more mindful about cleaning up after myself.
[0] http://hackage.haskell.org/package/base-4.12.0.0/docs/Debug-...
No comments yet.