
On Wed, Feb 4, 2015 at 5:02 PM, Eric Seidel
Right, it would also be useful for partial functions like head, so error has access to head's call-site when it produces a stack trace. The thing is, this feature is not free, as it adds an argument to each function that participates. So the question is, to what extent would you want to annotate library code with these CallStack parameters?
I don't actually care, since I never use those functions. I suppose one way to argue would be to say go ahead and add, since the only people using them are either a quick hack where crashing is ok, and thus probably don't care about micro-optimizing performance, or people who don't know any better, who are also not in the micro-optimization business. Or maybe people use them as a micro-optimization like e.g. unsafeIndex. But I don't know if it actually is a micro-optimization over e.g. 'case xs of [] -> error "..."', since 'head' probably compiles to just that. In any case, I have no horse in the race, but I'd say "put it on everything partial."