Location info for error message with multiple source locations
Currently:
MonadFailErrors.hs:16:5: error:
• Could not deduce (MonadFail m)
arising from a do statement
with the failable pattern ‘Just x’
from the context: Monad m
bound by the type signature for:
general :: Monad m => m a
at MonadFailErrors.hs:14:1-25
better:
MonadFailErrors.hs:16:5: error:
• Could not deduce (MonadFail m)
arising from a do statement
with the failable pattern ‘Just x’
from the context: Monad m
bound by the type signature for:
general :: Monad m => m a
MonadFailErrors.hs:14:1-25: defined here
Rationale:
Code editors (Emacs) react to file paths and line numbers in the first column and provide affordances, like go to file after clicking.
Related work:
Similar mechanism is used by VisualStudio C compiler, gcc, clang. All location information is put in front, so that jump to source code works reliably.
Trac metadata
| Trac field | Value |
|---|---|
| Version | 8.0.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture |