Provide GHC-like line snippets in messages
#87 (closed)
FixesThis merge request builds on top of !26 (merged), depends on curry-base!17 (merged) and implements GHC-like line previews in error/warning messages.
Example:
data Test a = Test
demo = case 4 of
_ -> 3
_ -> 5
Output:
[2 of 2] Compiling TestThis ( src/TestThis.curry, src/.curry/TestThis.fcy )
src/TestThis.curry:1:11 Warning:
Unreferenced type variable `a'
|
1 | data Test a = Test
| ^
src/TestThis.curry:3:1-3:4 Warning:
Top-level binding with no type signature:
demo :: Prelude.Num a => a
|
3 | demo = case 7 of
| ^^^^
src/TestThis.curry:5:5-5:10 Warning:
Pattern matches are potentially unreachable
In a case alternative:
_ -> ...
|
5 | _ -> 5
| ^^^^^^
Edited by Fredrik Wieczerkowski