Skip to content

Commit

Permalink
unqualify refactoring templates
Browse files Browse the repository at this point in the history
  • Loading branch information
zliu41 committed Apr 15, 2020
1 parent 1ffea9c commit e70057a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions data/hlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1137,8 +1137,7 @@
# import qualified Control.Monad \
# yes = flip mapM -- Control.Monad.forM
# import qualified Control.Monad as CM \
# yes = flip mapM -- CM.forM @NoRefactor hlint bug: expected CM.forM, actual Control.Monad.forM
# @NoRefactor hlint bug: expected CM.forM, actual Control.Monad.forM \
# yes = flip mapM -- CM.forM
# import qualified Control.Monad as CM(forM,filterM) \
# yes = flip mapM -- CM.forM
# import Control.Monad as CM(forM,filterM) \
Expand All @@ -1153,7 +1152,7 @@
# main = A.id (stringValue id')
# import Prelude((==)) \
# import qualified Prelude as P \
# main = P.length xs == 0 -- P.null xs @NoRefactor hlint bug: null xs (missing "P.")
# main = P.length xs == 0 -- P.null xs
# main = hello .~ Just 12 -- hello ?~ 12
# foo = liftIO $ window `on` deleteEvent $ do a; b
# no = sort <$> f input `shouldBe` sort <$> x
Expand Down
2 changes: 1 addition & 1 deletion src/Hint/Match.hs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ matchIdea' sb declName HintRule{..} parent x = do
(e, tpl) = substitute' u rhs'
noParens = [varToStr $ fromParen' x | L _ (HsApp _ (varToStr -> "_noParen_") x) <- universe tpl]

tpl <- pure (performSpecial' tpl)
tpl <- pure $ unqualify' sa sb (performSpecial' tpl)
u <- pure (removeParens noParens u)

let res = addBracketTy' (addBracket' parent $ performSpecial' $ fst $ substitute' u $ unqualify' sa sb rhs')
Expand Down

0 comments on commit e70057a

Please sign in to comment.