Skip to content
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

Incorrect redundant backet suggestion with BlockArguments and operator sections #1573

Open
pnotequalnp opened this issue Feb 23, 2024 · 0 comments

Comments

@pnotequalnp
Copy link

When the operand of a left operator section is an application with the argument a lambda taking advantage of BlockArguments, an incorrect suggestion to remove the brackets around the application is given. Removal of these brackets would move the operator inside the lambda, resulting in a syntax error.

Example module:

{-# LANGUAGE BlockArguments #-}

module Example where

f = ((const 1 \_ -> ()) +)

Emitted suggestion:

Example.hs:5:6-23: Suggestion: Redundant bracket
Found:
  ((const 1 \ _ -> ()) +)
Perhaps:
  (const 1 \ _ -> () +)

Module after accepting the suggestion (syntax error):

{-# LANGUAGE BlockArguments #-}

module Example where

f = (const 1 \_ -> () +)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant