packages feed

ghc-lib-parser-ex 9.6.0.1 → 9.6.0.2

raw patch · 4 files changed

+26/−3 lines, 4 filesPVP: minor bump suggested

API additions: PVP suggests at least a minor version bump

API changes (from Hackage documentation)

+ Language.Haskell.GhclibParserEx.GHC.Hs.Expr: isTypedSplice :: HsExpr GhcPs -> Bool
+ Language.Haskell.GhclibParserEx.GHC.Hs.Expr: isUntypedSplice :: HsExpr GhcPs -> Bool

Files

ChangeLog.md view
@@ -1,5 +1,8 @@ # Changelog for ghc-lib-parser-ex +# 9.6.0.2 released+- New functions `isTypedSplice`, `isUntypedSpice`+ # 9.6.0.1 released - Add `&` to `baseFixities` - Add support for ghc-9.8 series: `GH_9_8`
ghc-lib-parser-ex.cabal view
@@ -1,6 +1,6 @@ cabal-version:  1.18 name:           ghc-lib-parser-ex-version:        9.6.0.1+version:        9.6.0.2 description:    Please see the README on GitHub at <https://github.com/shayne-fletcher/ghc-lib-parser-ex#readme> homepage:       https://github.com/shayne-fletcher/ghc-lib-parser-ex#readme bug-reports:    https://github.com/shayne-fletcher/ghc-lib-parser-ex/issues
src/Language/Haskell/GhclibParserEx/GHC/Hs/Expr.hs view
@@ -10,7 +10,12 @@   isVar, isPar, isApp, isOpApp, isAnyApp, isDo, isLexeme, isLambda, isQuasiQuote, isQuasiQuoteExpr, isQuasiQuoteSplice,  isOverLabel,   isDotApp, isTypeApp, isWHNF, isLCase,   isFieldPun, isFieldPunUpdate, isRecStmt, isLetStmt, isParComp, isMDo, isListComp, isMonadComp, isTupleSection, isString, isPrimLiteral,-  isSpliceDecl, isFieldWildcard, isUnboxed, isWholeFrac, isStrictMatch, isMultiIf, isProc, isTransStmt,+  isSpliceDecl,+#if !( defined(GHC_8_8) || defined(GHC_8_10) || defined (GHC_9_0) || defined (GHC_9_2) || defined(GHC_9_4) )+  -- ghc api >= 9.6.1+  isTypedSplice, isUntypedSplice,+#endif+  isFieldWildcard, isUnboxed, isWholeFrac, isStrictMatch, isMultiIf, isProc, isTransStmt,   hasFieldsDotDot,   varToStr, strToVar,   fromChar@@ -180,8 +185,16 @@   HsDoublePrim{} -> True   _ -> False +-- Since ghc-9.6.1, `HsTypedSplice` and `HsUntypedSplice` have been+-- top-level constuctors of `Language.Haskell.Syntax.Expr.HsExpr p`+#if !( defined(GHC_8_8) || defined(GHC_8_10) || defined (GHC_9_0) || defined (GHC_9_2) || defined(GHC_9_4) )+isTypedSplice, isUntypedSplice :: HsExpr GhcPs -> Bool+isTypedSplice = \case HsTypedSplice{} -> True; _ -> False+isUntypedSplice = \case HsUntypedSplice{} -> True; _ -> False+#endif+ isSpliceDecl :: HsExpr GhcPs -> Bool-#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6)+#if !( defined(GHC_8_8) || defined(GHC_8_10) || defined (GHC_9_0) || defined (GHC_9_2) || defined(GHC_9_4) ) isSpliceDecl = \case   HsTypedSplice{} -> True   HsUntypedSplice{} -> True
test/Test.hs view
@@ -389,6 +389,13 @@   , testCase "isSpliceDecl" $ test "$x" $ assert' . isSpliceDecl . unLoc   , testCase "isSpliceDecl" $ test "f$x" $ assert' . not . isSpliceDecl . unLoc   , testCase "isSpliceDecl" $ test "$(a + b)" $ assert' . isSpliceDecl . unLoc+#if !( defined(GHC_8_8) || defined(GHC_8_10) || defined (GHC_9_0) || defined (GHC_9_2) || defined(GHC_9_4) )+  -- ghc api >= 9.6.1+  , testCase "isTypedSplice" $ test "$$foo" $ assert' . isTypedSplice . unLoc+  , testCase "isTypedSplice" $ test "$foo" $ assert' . not . isTypedSplice . unLoc+  , testCase "isUntypedSplice" $ test "$foo" $ assert' . isUntypedSplice . unLoc+  , testCase "isUntypedSplice" $ test "$$foo" $ assert' . not . isUntypedSplice . unLoc+#endif   , testCase "isQuasiQuoteExpr" $ test "[expr|1 + 2|]" $ assert' . isQuasiQuoteExpr   , testCase "isQuasiQuoteExpr" $ test "[expr(1 + 2)]" $ assert' . not . isQuasiQuoteExpr   , testCase "isWholeFrac" $ test "3.2e1" $ assert' . isWholeFrac . unLoc