[Haskell-cafe] RFC: rewrite-with-location proposal

Eric Seidel eric at seidel.io
Wed Feb 4 23:51:24 UTC 2015


Evan Laforge <qdunkan at gmail.com> writes:

> I noticed a recent commit https://phabricator.haskell.org/D578
> implements this.  This is exciting!  But I suppose it's too late for
> 7.10?  Any chance of it making it in?

Heh, I probably should have made some noise about it... But there are
still some questions about to what extent to use it (if at all) in the
standard libraries, so I doubt it would be a good candidate for a last
minute merge to 7.10. I've actually been meaning to start a discussion
about where/whether we should use this feature in base, but it slipped
by the wayside. Thanks for the reminder!

> I should note that to me the most interesting part of this has nothing
> to do with debugging.  If you have a logging system, or tests, you
> need to have file name and line numbers.  I've always done it via a
> custom preprocessor, but this extension would allow me to get rid of
> the preprocessor, which is very nice.  It also seems simpler than the
> whole call stack thing because I only care about the first entry of
> the stack.

Yep, my original motivation was getting access to source locations
within embedded DSLs. The call-stack is a nice and easy extension, but
I'm not sure how useful it will be in practice, as the first function
that doesn't request a CallStack parameter will cut off the stack. This
means that the generated stacks will often be quite short, I imagine.

Eric


More information about the Haskell-Cafe mailing list