Open MangoIV opened 1 year ago
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 r
takes two arguments when it should actually take only one, what it should do is insert parenthesis around g 3
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.
BlockArguments
doesn't insert parens resulting in an error when applying the hint