-
Notifications
You must be signed in to change notification settings - Fork 199
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
-XBlockArguments
: Avoid Lambda incorrect
#1509
Comments
Some examples would be helpful! |
Before applying the hint: {-# LANGUAGE BlockArguments #-}
module BlockArgumentsHlint where
g :: Int -> a -> Bool
g _ _ = True
r :: (Int -> Bool) -> (Int -> Bool)
r = id
f :: Int -> Bool
f = r \x -> g 3 x after applying the hint: {-# LANGUAGE BlockArguments #-}
module BlockArgumentsHlint where
g :: Int -> a -> Bool
g _ _ = True
r :: (Int -> Bool) -> (Int -> Bool)
r = id
f :: Int -> Bool
f = r g 3 |
now |
so the correct refactoring would be {-# LANGUAGE BlockArguments #-}
module BlockArgumentsHlint where
g :: Int -> a -> Bool
g _ _ = True
r :: (Int -> Bool) -> (Int -> Bool)
r = id
f :: Int -> Bool
f = r (g 3) |
Thanks! This seems more involved than a good first issue, and may or may not have to do with apply-refact. Will have a closer look later. |
Here is an instance I encountered while working in vscode with the hls: localScope x v = local \ env -> Map.insert x v env The hint is
If I apply this hint, I am getting the incorrect localScope x v = local Map.insert x v A |
Fix: #1634 |
Thank you for fixing this! ❤️ |
@MangoIV Thanks for the bug report. Sorry for the delay, it totally slipped my mind. |
BlockArguments
doesn't insert parens resulting in an error when applying the hintThe text was updated successfully, but these errors were encountered: