Hacker News new | ask | show | jobs
by spockz 54 days ago
Sure you want logging and tracing (in the RPC sense not Debug.Trace.trace).

Most of this can still be done from IO places where the pure functions collect enough error information bubbling up (e.g. content and line/col of parser errors etc.) to not need ad hoc print statements for debugging.

2 comments

In practice this just doesn't happen because you've composed a bunch of pure functions with various branches within them.

You lose the ability to log "why" some effect is happening.

Eh sure. But you can always collect/carry decisions in something like an Either. When using arrows or your own monadic bindings it is even possible to abstract this away from view.
Yes, definitely wouldn't use print because in an async environment that will get garbled. A proper logging library is the way to go.