snoyberg / mono-traversable

Type classes for mapping, folding, and traversing monomorphic containers
155 stars 64 forks source link

Make uses of trace leave warnings #136

Open yairchu opened 7 years ago

yairchu commented 7 years ago

It's nice to have trace and its variant leave warnings when used, via

{-# WARNING trace "Leaving traces in the code" #-}

(As done here)

This way you can use traces for debugging but have warnings to help you remember to remove them and not leave stale traces in your code.

snoyberg commented 7 years ago

Unless I'm mistaken, this would involve defining a new version of the trace identifier, which would now conflict with Debug.Trace. This would be a breaking change, but I'm OK with the idea (we do this already for undefined). Am I mistaken about my assumptions on this? Otherwise, interested in sending a PR?

On Sat, Oct 7, 2017 at 9:23 PM, Yair Chuchem notifications@github.com wrote:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/snoyberg/mono-traversable/issues/136, or mute the thread https://github.com/notifications/unsubscribe-auth/AADBB1bYbdJZgqRylzsYAfv8_zU0KQLUks5sp8GVgaJpZM4Pxchw .

yairchu commented 7 years ago

Yes, this would define a new trace function which is a proxy for Debug.Trace.trace. iiuc that's fine so I'll proceed with a PR