The tracing monad is fascinating. What would be a practical application of it? I've been studying monads through Learn You a Haskell for Great Good but haven't been able to put them into context (other than isolating side effects and enforcing order of execution).
https://github.com/pufuwozu/roy/blob/master/test/trace_monad...
let traceMonad = {
return: fn x =
console.log "Return:" x
x
bind: fn x f =
console.log "Binding:" x
f x
}
console.log (do traceMonad
bind w = 1
let x = 2
bind y = 3
bind z = 4
return w + x + y + z
)