-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extra space with negation operator #694
Comments
I don't consider this a bug. I wonder if we should keep this open. |
✨ This is an old work account. Please reference @brandonchinn178 for all future communication ✨ Sure, this could be considered a feature request. I think this is a worthwhile issue, though, because |
But |
✨ This is an old work account. Please reference @brandonchinn178 for all future communication ✨ Yes, but the point of a formatter is to enforce consistent style for the sake of readability across a codebase. IMO, |
✨ This is an old work account. Please reference @brandonchinn178 for all future communication ✨ Adding on to this, f n = n-1 gets reformatted to f n = n -1 Distinguishing between negation operator and minus would be nice |
The reason why ormolu adds spaces after In #734, I added This means that f x = 1 / (1 + exp (-x)) is a fixed point, and f n = n-1 is formatted into f n = n - 1 As a side note: GHC 9.0 added the new extension {-# LANGUAGE LexicalNegation #-}
add2AndSubtract3 :: Bifunctor f => f Int Int -> f Int Int
add2AndSubtract3 = bimap (+ 2) (- 3) is a fixed point, and add2AndSubtract3 :: Bifunctor f => f Int Int -> f Int Int
add2AndSubtract3 = bimap (+ 2) (-3) which makes it easy to spot that something is wrong. |
Describe the bug
To Reproduce
gets reformatted as
Apparently GHC still treats this as equivalent, but it's very easy to mistakenly read it as a partially applied
-
Expected behavior
(-x)
should kept as(-x)
Environment
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: