When HasCallStack was introduced we intentionally did not introduce constraints to partial functions, no matter how small. IIRC this was in part because we expected third-party libraries to fill this need and in part it was out of concern for performance (since you would incur the cost of an additional argument, and potentially allocation, if the function isn't inlined). However, at this point it seems like HasCallStack is pretty well-accepted. It seems to me that we could start considering slowly adding HasCallStacks around in functions that are either (a) nearly certain to inline, or (b) not performance critical.
There were also concerns about API stability, particularly since the original implementation exposed the implicit parameter. Now that we have the HasCallStack alias and a decent set of API functions around it, we could swap out the implementation, if necessary, with less potential for client breakage.
I'd support starting to add HasCallStack constraints to common partial functions like fromJust, head, etc. Though, is this something that should be discussed with the Core Libraries Committee?
However, I should emphasize to that we don't want to simply scatter HasCallStacks on every partial function. We should be thoughtful and deliberate (and probably consult with the CLC) when making changes like this.
I really like GHC's internal HasDebugCallStack, which disappears (that is, becomes ()) when DEBUG is not defined via CPP and becomes HasCallStack when DEBUG is defined. As far as I know, there's no standard way to mark a build meant for debugging, but perhaps there should be. Then, we could do the same for all applications instead of just GHC.
I really like GHC's internal HasDebugCallStack, which disappears (that is, becomes ()) when DEBUG is not defined via CPP and becomes HasCallStack when DEBUG is defined. As far as I know, there's no standard way to mark a build meant for debugging, but perhaps there should be. Then, we could do the same for all applications instead of just GHC.
In addition to making this available to users of GHC, there should probably be an additional side-effect to the DEBUG flag, or a separate flag, that turns HasDebugCallStack on for all functions
We already have a very similar mechanism for Control.Exception.assert occurrences at compile-time. It would be reasonably straightforward to add a similar flag for a magic synonym of HasCallStack.