purescript-contrib/purescript-parsing

lazy errors

jamesdbrock opened this issue · 1 comments

We should probably change all error messages to be lazy like this with defer.

I chose to make error messages deferred to avoid the cost of generating the error messages until they're needed. Feels like a small thing, but the waste just bothers me too much.

Originally posted by @fsoikin in #127 (comment)

It turns out that making all errors lazy is pointless, because most of them are actually constant strings.

Still, a facility for doing that would be useful, I think. So I added a facility and made use of it in those places where the error messages are not trivial.