Infer HasCallStack where possible
Consider
Prelude> :t error
error :: GHC.Stack.Types.HasCallStack => [Char] -> a
Prelude> :t (\x -> error x)
(\x -> error x)
:: (?callStack::GHC.Stack.Types.CallStack) => [Char] -> a
We would prefer to get the same type for the latter as the former.
Moreover, when we execute on #11376 (closed) (comment 25), :t error
will show the more complicated type too.
My suggestion: during generalisation, when we see ?callStack::CallStack
, use the built-in type synonym HasCallStack
. Note that this should only happen if the name used for the implicit parameter is actually ?callstack
.
Eric would you like to consider this?
Trac metadata
Trac field | Value |
---|---|
Version | 7.10.3 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |