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

build-depends: ghc-lib-parser-ex >= 9.8.0.1 #1574

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hlint.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ library
build-depends:
ghc-lib-parser == 9.8.*
build-depends:
ghc-lib-parser-ex >= 9.8.0.0 && < 9.8.1
ghc-lib-parser-ex >= 9.8.0.1 && < 9.8.1

if flag(gpl)
build-depends: hscolour >= 1.21
Expand Down
Binary file added src/.DS_Store
Binary file not shown.
4 changes: 4 additions & 0 deletions src/Hint/Extensions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,10 @@ used EmptyCase = hasS f
f _ = False
used KindSignatures = hasT (un :: HsKind GhcPs)
used BangPatterns = hasS isPBangPat ||^ hasS isStrictMatch
where
-- Todo: Fix typing bug in ghc-lib-parser-ex.
isStrictMatch :: HsMatchContext GhcPs -> Bool
isStrictMatch = \case FunRhs{mc_strictness=SrcStrict} -> True; _ -> False
used TemplateHaskell = hasS (not . isQuasiQuoteSplice) ||^ hasS isTypedSplice
used TemplateHaskellQuotes = hasS f
where
Expand Down
4 changes: 1 addition & 3 deletions src/Hint/Lambda.hs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ import GHC.Types.Name.Occurrence
import GHC.Types.Name.Reader
import GHC.Types.SrcLoc
import Language.Haskell.GhclibParserEx.GHC.Hs.Expr (isTypeApp, isOpApp, isLambda, isQuasiQuoteExpr, isVar, isDol, strToVar)
import Language.Haskell.GhclibParserEx.GHC.Hs.Pat (isWildPat)
import Language.Haskell.GhclibParserEx.GHC.Utils.Outputable
import Language.Haskell.GhclibParserEx.GHC.Types.Name.Reader
import GHC.Util.Brackets (isAtom)
Expand Down Expand Up @@ -346,9 +347,6 @@ mkOrigPats funName pats = (zipWith munge vars pats', vars)
in (used, (True, p))
| otherwise = (mempty, (False, p))

isWildPat :: LPat GhcPs -> Bool
isWildPat = \case (L _ (WildPat _)) -> True; _ -> False

-- Replace the pattern with a variable pattern if the pattern doesn't contain wildcards.
munge :: String -> (Bool, LPat GhcPs) -> LPat GhcPs
munge _ (True, p) = p
Expand Down
2 changes: 1 addition & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ packages:

extra-deps:
- ghc-lib-parser-9.8.1.20231009
- ghc-lib-parser-ex-9.8.0.0
- ghc-lib-parser-ex-9.8.0.1
# To test hlint against experimental builds of ghc-lib-parser-ex,
# modify extra-deps like this:
# - archive: /users/shayne/project/ghc-lib-parser-ex/ghc-lib-parser-ex-8.10.0.18.tar.gz
Expand Down
Loading