Closed sergv closed 8 years ago
Hi, thank you for reporting this and submitting a patch. I fixed the issue by increasing the precedence of unary minus. This was a slightly smaller change, and it accepts slightly more inputs, although I think you are entirely right in that the only likely useful case is negating numbers. Let me know if this doesn't work as expected. I put the new version on hackage---version 1.6.10.
It works well, thanks :+1:
Currently ppsh cannot parse the following
FooCostructorWithLongName {veryLongFieldName = [(-1 :| [],(2 :| []) :| [])]}
However, it can succesfully parse and prettyprint after small change:
FooCostructorWithLongName {veryLongFieldName = [(1 :| [],(2 :| []) :| [])]}
As far as I know, only numbers in Show output can be preceded by the minus sign, therefore it makes sense to move minus closer to numbers in order to reduce parser's confusion.