packages feed

breakpoint 0.1.2.2 → 0.1.3.0

raw patch · 8 files changed

+172/−235 lines, 8 filesdep ~ansi-terminaldep ~basedep ~containersPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: ansi-terminal, base, containers, deepseq, ghc, haskeline, mtl, pretty-simple, template-haskell, text, transformers

API changes (from Hackage documentation)

- Debug.Breakpoint.GhcFacade: locA' :: SrcSpanAnn' ann -> SrcSpan
- Debug.Breakpoint.GhcFacade: noLocA' :: a -> LocatedAn an a
- Debug.Breakpoint.GhcFacade: pattern BindStmt' :: XBindStmt GhcRn GhcRn body -> LPat GhcRn -> body -> SyntaxExpr GhcRn -> SyntaxExpr GhcRn -> Stmt GhcRn body
- Debug.Breakpoint.GhcFacade: type LexicalFastString' = LexicalFastString
+ Debug.Breakpoint.GhcFacade: pattern CDictCan' :: CtEvidence -> Class -> [Xi] -> Ct
- Debug.Breakpoint.GhcFacade: fromLexicalFastString :: LexicalFastString' -> FastString
+ Debug.Breakpoint.GhcFacade: fromLexicalFastString :: LexicalFastString -> FastString
- Debug.Breakpoint.GhcFacade: mkLexicalFastString :: FastString -> LexicalFastString'
+ Debug.Breakpoint.GhcFacade: mkLexicalFastString :: FastString -> LexicalFastString

Files

CHANGELOG.md view
@@ -1,5 +1,9 @@ # Revision history for breakpoint +## 0.1.3.0 -- 2023-10-28+* Support GHC 9.8.x+* Drop support for GHC 8.10.x and 9.0.x+ ## 0.1.2.2 -- 2023-09-02 * Improvement to instance resolution for showing arbitrary values * Strictly evaluate variable output before modifying timeouts
+ README.md view
@@ -0,0 +1,108 @@+# Breakpoint++The ability to set breakpoints in a program can provide valuable insights when+debugging. While GHCi has built-in support for setting breakpoints, it is not+actively maintained and suffers from several critical limitations:+- It's prohibitively buggy when used with concurrent programs, such as web servers.+- Breakpoints can only be set in interpreted code.+- Occasionally it simply doesn't work at all.++The `breakpoint` library solves these problems by implementing breakpoints as+a GHC plugin.++### Usage++Add `breakpoint` as a dependency to your project then enable breakpoints in a+module by adding `{-# OPTIONS_GHC -fplugin Debug.Breakpoint #-}` to the top of+the file and importing the `Debug.Breakpoint` module. You can then use the+`breakpoint`, `breakpointIO`, or `breakpointM` functions as appropriate to set+a breakpoint.++- `breakpoint :: a -> a` is for use in pure code. Apart from the side-effect of+  setting a breakpoint, it is the identity function. The value passed to `breakpoint`+  will appear as a variable called `*result` in the output.+- `breakpointIO :: MonadIO m => m ()` is for monadic code that can perform IO.+- `breakpointM :: Applicative f => f ()` is for arbitrary `Applicative`+  contexts.++`breakpoint` and `breakpointM` both use `unsafePerformIO` which means they are+at the mercy of the simplifier and all the other pitfalls of lazy IO. For this+reason, it's generally preferable to use `breakpointIO` in contexts that+support it.++Here's an example module:+```haskell+{-# OPTIONS_GHC -fplugin Debug.Breakpoint #-}++import Debug.Breakpoint++main :: IO ()+main = do+  x <- getLine+  let y = 2 :: Int+      z = id :: Bool -> Bool+  breakpointIO+  pure ()+```++When the breakpoint expression gets evaluated, you will see terminal output such+as+```+### Breakpoint Hit ###+(app/Main.hs:24:3-6)+x =+  "input"++y =+  2++z =+  <Bool -> Bool>++Press enter to continue+```+showing the location of the breakpoint and the free variables that are visible+from the callsite, this includes function arguments, let bindings, where binds,+monadic binds, pattern binds, etc.++If the type of a value has a `Show` instance then that will be used to generate+the printed value, otherwise the output will contain the type of the value+within angle brackets.++Execution of the program effectively halts on waiting for user input. In+concurrent programs, all threads will be stopped, not just the one executing+the breakpoint.++### Querying variables++In contrast to the standard breakpoint functions which print out the values for+all current variables, the `queryVars`, `queryVarsM`, and `queryVarsIO`+functions first print the variables names and then initiate a prompt where you+can enter a specific variable name to have its value printed.++This is useful if you are only interested in certain values or if printing one+or more values would result in a non-terminating process (an infinite data+structure for example).++You can tab-complete variable names at the query prompt. Only the current+thread is blocked while the prompt is active. To resume execution, press enter+with a blank line.++### Caveats+- Currently supports GHC version 9.2.x - 9.8.x+- Printing values may cause thunks to be evaluated earlier than they otherwise+  would which could be problematic for programs that rely heavily on laziness.+- `ApplicativeDo` can sometimes cause variables that are in scope to not be traced.+- Implicit params are not currently supported+- `RecursiveDo` binds aren't visible before they are bound, despite being in scope.+- If there is anything buffered in `stdin` then that will interfere with the+  blocking mechanism.+- On Windows or when using the non-threaded runtime, calls to+  `threadDelay` are not suspended by breakpoints in the sense that time+  continues to elapse, however they won't unblock until the breakpoint+  finishes.+- Variables being traced cannot have a type that contains type variables with+  class constraints, otherwise you get a compiler error. This happens most+  commonly with a where clause binding that lacks a type signature. You can+  deal with this by using `excludeVars` or giving a type signature to the+  binding that doesn't introduce such type variables.
breakpoint.cabal view
@@ -1,27 +1,26 @@ cabal-version:      3.0 name:               breakpoint-version:            0.1.2.2+version:            0.1.3.0 synopsis:   Set breakpoints using a GHC plugin  description:   A plugin that allows you to set breakpoints for debugging purposes. -  See the [README](https://github.com/aaronallen8455/breakpoint#breakpoint) for details.- -- A URL where users can report bugs. -- bug-reports: license:            MIT license-file:       LICENSE author:             Aaron Allen maintainer:         aaronallen8455@gmail.com-tested-with: GHC==9.6.1, GHC==9.4.2, GHC==9.2.2, GHC==9.0.2, GHC==8.10.7+tested-with: GHC==9.8.1, GHC==9.6.1, GHC==9.4.2, GHC==9.2.2 bug-reports: https://github.com/aaronallen8455/breakpoint/issues  -- A copyright notice. -- copyright: category:           Development extra-source-files: CHANGELOG.md+extra-doc-files: README.md  library     exposed-modules:  Debug.Breakpoint,@@ -34,17 +33,17 @@      -- LANGUAGE extensions used by modules in this package.     -- other-extensions:-    build-depends:    base >=4.14.0.0 && <4.19.0.0,-                      ghc,-                      containers,-                      mtl,-                      transformers,-                      haskeline >= 0.8.2,-                      pretty-simple >= 4.0.0.0,-                      text,-                      template-haskell,-                      ansi-terminal,-                      deepseq+    build-depends:    base >= 4.16.0.0 && < 4.20.0.0,+                      ghc >= 9.2.0 && < 9.9,+                      containers >= 0.6.5 && < 0.7,+                      mtl >= 2.2.2 && < 2.4,+                      transformers >= 0.5.6 && < 0.7,+                      haskeline >= 0.8.2 && < 0.9,+                      pretty-simple >= 4.1.2 && < 4.2,+                      text >= 1.2.5 && < 2.2,+                      template-haskell >= 2.18.0 && < 2.22,+                      ansi-terminal >= 1.0 && < 1.1,+                      deepseq >= 1.0 && < 1.6     hs-source-dirs:   src     default-language: Haskell2010     ghc-options: -Wall@@ -59,9 +58,8 @@   default-language: Haskell2010   ghc-options: -fplugin Debug.Breakpoint ---executable play---  main-is: Main.hs---  hs-source-dirs: play---  build-depends: base, breakpoint---  default-language: Haskell2010---  ghc-options: -fplugin Debug.Breakpoint+-- executable play+--   main-is: Main.hs+--   hs-source-dirs: play+--   build-depends: base, breakpoint+--   default-language: Haskell2010
src/Debug/Breakpoint.hs view
@@ -224,14 +224,8 @@ getSrcLoc :: String getSrcLoc = "" -#if MIN_VERSION_ghc(9,2,0) -- Use an "unsafe" foreign function to more or less stop the runtime.--- In older GHCs this can cause out of control CPU usage so settle for getLine instead foreign import ccall unsafe "stdio.h getchar" blockOnInput :: IO Int-#else-blockOnInput :: IO Int-blockOnInput = 1 <$ getLine-#endif  -- | Excludes the given variable names from appearing in the output of any -- breakpoints occurring in the given expression.@@ -260,7 +254,6 @@ instance ShowLev 'Exts.IntRep Exts.Int# where   showLev i = show $ I# i -#if MIN_VERSION_base(4,16,0) instance ShowLev 'Exts.Int8Rep Exts.Int8# where   showLev i = show $ I8# i @@ -269,7 +262,6 @@  instance ShowLev 'Exts.Int32Rep Exts.Int32# where   showLev i = show $ I32# i-#endif  #if MIN_VERSION_base(4,17,0) instance ShowLev 'Exts.Int64Rep Exts.Int64# where@@ -279,7 +271,6 @@ instance ShowLev 'Exts.WordRep Exts.Word# where   showLev w = show $ W# w -#if MIN_VERSION_base(4,16,0) instance ShowLev 'Exts.Word8Rep Exts.Word8# where   showLev w = show $ W8# w @@ -288,7 +279,6 @@  instance ShowLev 'Exts.Word32Rep Exts.Word32# where   showLev w = show $ W32# w-#endif  #if MIN_VERSION_base(4,17,0) instance ShowLev 'Exts.Word64Rep Exts.Word64# where
src/Debug/Breakpoint/GhcFacade.hs view
@@ -5,13 +5,10 @@ module Debug.Breakpoint.GhcFacade   ( module Ghc   , liftedRepName-  , LexicalFastString'   , mkLexicalFastString   , fromLexicalFastString   , collectHsBindBinders'   , collectPatBinders'-  , noLocA'-  , locA'   , mkWildValBinder'   , pprTypeForUser'   , showSDocOneLine'@@ -20,8 +17,8 @@   , pattern HsLet'   , pattern LetStmt'   , pattern ExplicitList'-  , pattern BindStmt'   , pattern OverLit'+  , pattern CDictCan'   ) where  #if MIN_VERSION_ghc(9,6,0)@@ -133,147 +130,24 @@ import           GHC.Hs.Expr as Ghc import           GHC.Tc.Types.Origin as Ghc -#elif MIN_VERSION_ghc(9,0,0)-import           GHC.Driver.Plugins as Ghc hiding (TcPlugin)-import           GHC.Driver.Finder as Ghc-import           GHC.Hs.Extension as Ghc-import           GHC.Tc.Types as Ghc-import qualified GHC.Tc.Plugin as Plugin-import           GHC.Parser.Annotation as Ghc-import           GHC.Types.SrcLoc as Ghc-import           GHC.Types.Name as Ghc-import           GHC.Iface.Env as Ghc-import           GHC.Unit.Module.Name as Ghc-import           GHC.Tc.Utils.Monad as Ghc hiding (TcPlugin)-import           GHC.Data.FastString as Ghc-import           GHC.Hs.Utils as Ghc-import           GHC.Types.Unique.Set as Ghc-import           GHC.Utils.Outputable as Ghc-import           GHC.Hs.Binds as Ghc-import           GHC.Data.Bag as Ghc-import           GHC.Types.Basic as Ghc-import           GHC.Types.Name.Env as Ghc-import           GHC.Builtin.Types as Ghc-import           GHC.Core.TyCo.Rep as Ghc-import           GHC.Tc.Types.Constraint as Ghc-import           GHC.Core.Make as Ghc-import           GHC.Tc.Types.Evidence as Ghc-import           GHC.Types.Id as Ghc-import           GHC.Core.InstEnv as Ghc-import           GHC.Core.Class as Ghc hiding (FunDep)-import           GHC.Tc.Utils.TcType as Ghc-import           GHC.Core.Type as Ghc-import           GHC.Core.TyCon as Ghc-import           GHC.Core.Ppr.TyThing as Ghc-import           GHC.Driver.Types as Ghc-import           GHC.Driver.Session as Ghc-import           GHC.Hs.Expr as Ghc-import           GHC.Hs.Pat as Ghc-import           GHC.Hs.Decls as Ghc-import           GHC.Hs.Lit as Ghc-import           GHC.Tc.Types.Origin as Ghc--#elif MIN_VERSION_ghc(8,10,0)-import           GHC.Hs.Expr as Ghc-import           GHC.Hs.Extension as Ghc-import           GHC.Hs.Binds as Ghc-import           GHC.Hs.Lit as Ghc-import           SrcLoc as Ghc-import           GHC.Hs.Utils as Ghc-import           Name as Ghc-import           GHC.Hs.Pat as Ghc-import           FastString as Ghc-import           TysWiredIn as Ghc-import           InstEnv as Ghc-import           TcEvidence as Ghc-import           TyCoRep as Ghc-import           MkCore as Ghc-import           PprTyThing as Ghc-import           Outputable as Ghc-import           TcRnTypes as Ghc-import           Type as Ghc-import           TcType as Ghc-import           Id as Ghc-import           Class as Ghc-import           Constraint as Ghc-import           Module as Ghc-import           HscTypes as Ghc-import           TyCon as Ghc-import           Bag as Ghc-import           BasicTypes as Ghc-import           UniqSet as Ghc-import           NameEnv as Ghc-import           IfaceEnv as Ghc-import           Finder as Ghc hiding (findImportedModule)-import           TcPluginM as Ghc hiding (lookupOrig, getTopEnv, getEnvs, newUnique)-import           GHC.Hs.Decls as Ghc-import           TcRnMonad as Ghc-import           Plugins as Ghc hiding (TcPlugin)-import           DynFlags as Ghc-import qualified TcPluginM as Plugin-import           TcOrigin as Ghc #endif  liftedRepName :: Ghc.Name-#if MIN_VERSION_ghc(9,2,0) liftedRepName = Ghc.getName Ghc.liftedRepTyCon-#else-liftedRepName = Ghc.getName Ghc.liftedRepDataCon-#endif -#if MIN_VERSION_ghc(9,2,0)-type LexicalFastString' = Ghc.LexicalFastString-#else-type LexicalFastString' = Ghc.FastString-#endif--mkLexicalFastString :: Ghc.FastString -> LexicalFastString'-fromLexicalFastString :: LexicalFastString' -> Ghc.FastString-#if MIN_VERSION_ghc(9,2,0)+mkLexicalFastString :: Ghc.FastString -> Ghc.LexicalFastString+fromLexicalFastString :: Ghc.LexicalFastString -> Ghc.FastString mkLexicalFastString = Ghc.LexicalFastString fromLexicalFastString (Ghc.LexicalFastString fs) = fs-#else-mkLexicalFastString = id-fromLexicalFastString = id-#endif  collectHsBindBinders' :: Ghc.HsBindLR Ghc.GhcRn idR -> [Ghc.Name]-collectHsBindBinders' = Ghc.collectHsBindBinders-#if MIN_VERSION_ghc(9,2,0)-                          Ghc.CollNoDictBinders-#endif+collectHsBindBinders' = Ghc.collectHsBindBinders Ghc.CollNoDictBinders  collectPatBinders' :: Ghc.LPat Ghc.GhcRn -> [Ghc.Name]-collectPatBinders' = Ghc.collectPatBinders-#if MIN_VERSION_ghc(9,2,0)-                       Ghc.CollNoDictBinders-#endif--noLocA'-#if MIN_VERSION_ghc(9,2,0)-  :: a -> LocatedAn an a-noLocA'-  = noLocA-#else-  :: a -> Located a-noLocA'-  = noLoc-#endif--#if MIN_VERSION_ghc(9,2,0)-locA' :: Ghc.SrcSpanAnn' ann -> Ghc.SrcSpan-locA' = Ghc.locA-#else-locA' :: Ghc.SrcSpan -> Ghc.SrcSpan-locA' = id-#endif+collectPatBinders' = Ghc.collectPatBinders Ghc.CollNoDictBinders  mkWildValBinder' :: Ghc.Type -> Ghc.Id-#if MIN_VERSION_ghc(9,0,0) mkWildValBinder' = Ghc.mkWildValBinder Ghc.oneDataConTy-#else-mkWildValBinder' = Ghc.mkWildValBinder-#endif  pprTypeForUser' :: Ghc.Type -> Ghc.SDoc #if MIN_VERSION_ghc(9,4,0)@@ -283,15 +157,7 @@ #endif  showSDocOneLine' :: Ghc.SDoc -> String-showSDocOneLine' =-#if MIN_VERSION_ghc(9,2,0)-  Ghc.showSDocOneLine Ghc.defaultSDocContext-#elif MIN_VERSION_ghc(9,0,0)-  Ghc.showSDocOneLine-    $ Ghc.initDefaultSDocContext Ghc.unsafeGlobalDynFlags-#else-  Ghc.showSDocOneLine Ghc.unsafeGlobalDynFlags-#endif+showSDocOneLine' = Ghc.showSDocOneLine Ghc.defaultSDocContext  findImportedModule' :: Ghc.ModuleName -> Ghc.TcPluginM Ghc.FindResult #if MIN_VERSION_ghc(9,4,0)@@ -370,27 +236,6 @@     ExplicitList' x exprs = Ghc.ExplicitList x Nothing exprs #endif -#if MIN_VERSION_ghc(9,0,0)-mkSyntaxExprs :: x -> (SyntaxExpr Ghc.GhcRn, SyntaxExpr Ghc.GhcRn, x)-mkSyntaxExprs x = (Ghc.noSyntaxExpr, Ghc.noSyntaxExpr, x)-#endif--pattern BindStmt'-  :: Ghc.XBindStmt Ghc.GhcRn Ghc.GhcRn body-  -> Ghc.LPat Ghc.GhcRn-  -> body-  -> SyntaxExpr Ghc.GhcRn-  -> SyntaxExpr Ghc.GhcRn-  -> Ghc.Stmt Ghc.GhcRn body-#if MIN_VERSION_ghc(9,0,0)-pattern BindStmt' x pat body expr1 expr2-    <- Ghc.BindStmt x pat (mkSyntaxExprs -> (expr1, expr2, body))-  where-    BindStmt' x pat body _ _ = Ghc.BindStmt x pat body-#else-pattern BindStmt' x pat body bindExpr failExpr = Ghc.BindStmt x pat body bindExpr failExpr-#endif- pattern OverLit'   :: Ghc.OverLitVal   -> Ghc.HsOverLit Ghc.GhcRn@@ -400,3 +245,16 @@ #else   <- Ghc.OverLit _ lit _ #endif++pattern CDictCan'+  :: Ghc.CtEvidence+  -> Ghc.Class+  -> [Ghc.Xi]+  -> Ghc.Ct+pattern CDictCan' diEv diCls diTys+#if MIN_VERSION_ghc(9,8,0)+  <- Ghc.CDictCan (Ghc.DictCt diEv diCls diTys _)+#else+  <- Ghc.CDictCan { Ghc.cc_ev = diEv, Ghc.cc_class = diCls, Ghc.cc_tyargs = diTys }+#endif+
src/Debug/Breakpoint/Renamer.hs view
@@ -96,7 +96,7 @@         = Ghc.nlHsLit . Ghc.mkHsString         . Ghc.showSDocUnsafe         . Ghc.ppr-        $ Ghc.locA' loc+        $ Ghc.locA loc        captureVarsExpr mResultName =         let mkTuple (Ghc.fromLexicalFastString -> varStr, n) =@@ -104,11 +104,9 @@                 [ Ghc.nlHsLit . Ghc.mkHsString $ Ghc.unpackFS varStr                 , Ghc.nlHsApp (Ghc.nlHsVar showLevName) (Ghc.nlHsVar n)                 ]-#if MIN_VERSION_ghc(9,2,0)                 Ghc.NoExtField-#endif -            mkList exprs = Ghc.noLocA' (Ghc.ExplicitList' Ghc.NoExtField exprs)+            mkList exprs = Ghc.noLocA (Ghc.ExplicitList Ghc.NoExtField exprs)              varSetWithResult               | Just resName <- mResultName =@@ -237,9 +235,6 @@   grhRes <- addScopedVars names $ recurse m_grhss   pure $ Just     Ghc.Match { Ghc.m_grhss = grhRes, .. }-#if !MIN_VERSION_ghc(9,0,0)-matchCase _ = pure Nothing-#endif  extractVarPats :: Ghc.LPat Ghc.GhcRn -> VarSet extractVarPats = mkVarSet . Ghc.collectPatBinders'@@ -253,25 +248,14 @@ grhssCase Ghc.GRHSs {..} = do   (localBindsRes, names)     <- dealWithLocalBinds-#if MIN_VERSION_ghc(9,2,0)          grhssLocalBinds-#else-         (Ghc.unLoc grhssLocalBinds)-#endif    grhsRes <- addScopedVars names $ recurse grhssGRHSs   pure $ Just     Ghc.GRHSs { Ghc.grhssGRHSs = grhsRes-#if MIN_VERSION_ghc(9,2,0)               , grhssLocalBinds = localBindsRes-#else-              , grhssLocalBinds = localBindsRes <$ grhssLocalBinds-#endif               , ..               }-#if !MIN_VERSION_ghc(9,0,0)-grhssCase _ = pure Nothing-#endif  dealWithBind :: VarSet              -> Ghc.LHsBind Ghc.GhcRn@@ -337,9 +321,6 @@   (guardsRes, names) <- runWriterT $ dealWithStatements guards   bodyRes <- addScopedVars names $ recurse body   pure . Just $ Ghc.GRHS x guardsRes bodyRes-#if !MIN_VERSION_ghc(9,0,0)-grhsCase _ = pure Nothing-#endif  -------------------------------------------------------------------------------- -- Let Binds (Non-do)@@ -427,11 +408,11 @@              => Ghc.Stmt Ghc.GhcRn body              -> WriterT VarSet EnvReader (Ghc.Stmt Ghc.GhcRn body) dealWithStmt = \case-  Ghc.BindStmt' x lpat body bindExpr failExpr -> do+  Ghc.BindStmt x lpat body -> do     let names = extractVarPats lpat     tell names     bodyRes <- lift $ recurse body-    pure $ Ghc.BindStmt' x lpat bodyRes bindExpr failExpr+    pure $ Ghc.BindStmt x lpat bodyRes    Ghc.LetStmt' x (Ghc.L loc localBinds) -> do     (bindsRes, names) <- lift $ dealWithLocalBinds localBinds@@ -447,9 +428,6 @@             tell $ extractVarPats bv_pattern             (stmtsRes, _) <- lift . runWriterT $ dealWithStatements app_stmts             pure a {Ghc.app_stmts = stmtsRes}-#if !MIN_VERSION_ghc(9,0,0)-          a -> lift $ gmapM recurse a-#endif     pairsRes <- (traverse . traverse) dealWithAppArg pairs     pure $ Ghc.ApplicativeStmt x pairsRes mbJoin @@ -476,9 +454,6 @@           _ -> empty -- TODO what other cases should be handled?          pure $ Ghc.HsCmdTop x2 cmdRes-#if !MIN_VERSION_ghc(9,0,0)-      _ -> empty-#endif     pure $ Ghc.HsProc x1 lpat cmdTopRes hsProcCase _ = pure Nothing @@ -489,7 +464,7 @@ -- The writer is for tracking if an inner expression contains the target name type EnvReader = WriterT Any (ReaderT Env Ghc.TcM) -type VarSet = M.Map Ghc.LexicalFastString' Ghc.Name+type VarSet = M.Map Ghc.LexicalFastString Ghc.Name  data Env = MkEnv   { varSet :: !VarSet@@ -515,7 +490,7 @@ overVarSet :: (VarSet -> VarSet) -> Env -> Env overVarSet f env = env { varSet = f $ varSet env } -getOccNameFS :: Ghc.Name -> Ghc.LexicalFastString'+getOccNameFS :: Ghc.Name -> Ghc.LexicalFastString getOccNameFS = Ghc.mkLexicalFastString . Ghc.occNameFS . Ghc.getOccName  mkVarSet :: [Ghc.Name] -> VarSet
src/Debug/Breakpoint/TimerManager.hs view
@@ -5,7 +5,7 @@   ( suspendTimeouts   ) where -#if defined(mingw32_HOST_OS) || !MIN_VERSION_ghc(9,2,0)+#if defined(mingw32_HOST_OS) -- Since Windows has its own timeout manager internals, I'm choosing not to support it for now.  suspendTimeouts :: IO a -> IO a@@ -43,14 +43,22 @@ psqKey =   $(pure $ VarE $       Name (OccName "key")+#if MIN_VERSION_ghc(9,8,0)+           (NameG (FldName "E") (PkgName "base") (ModName "GHC.Event.PSQ"))+#else            (NameG VarName (PkgName "base") (ModName "GHC.Event.PSQ"))+#endif    )  -- emTimeouts :: TimerManager -> IORef TimeoutQueue emTimeouts =   $(pure $ VarE $       Name (OccName "emTimeouts")+#if MIN_VERSION_ghc(9,8,0)+           (NameG (FldName "TimerManager") (PkgName "base") (ModName "GHC.Event.TimerManager"))+#else            (NameG VarName (PkgName "base") (ModName "GHC.Event.TimerManager"))+#endif    )  wakeManager :: TimerManager -> IO ()
src/Debug/Breakpoint/TypeChecker.hs view
@@ -8,11 +8,7 @@ import           Data.Either import           Data.Maybe import           Data.Traversable (for)-#if MIN_VERSION_ghc(9,0,0) import qualified GHC.Tc.Plugin as Plugin-#else-import qualified TcPluginM as Plugin-#endif  import qualified Debug.Breakpoint.GhcFacade as Ghc @@ -64,9 +60,9 @@   -> Ghc.Ct   -> FindWantedResult findShowLevWanted names ct-  | Ghc.CDictCan{..} <- ct-  , showLevClassName names == Ghc.getName cc_class-  , [Ghc.TyConApp tyCon [], arg2] <- cc_tyargs+  | Ghc.CDictCan' _ di_cls di_tys <- ct+  , showLevClassName names == Ghc.getName di_cls+  , [Ghc.TyConApp tyCon [], arg2] <- di_tys   = if Ghc.getName tyCon == Ghc.liftedRepName        then FoundLifted arg2 ct        else FoundUnlifted arg2 ct@@ -77,10 +73,10 @@   -> Ghc.Ct   -> Maybe (Ghc.Type, Ghc.Ct) findShowWithSuperclass names ct-  | Ghc.CDictCan{..} <- ct-  , Ghc.getName (showClass names) == Ghc.getName cc_class-  , hasShowLevSuperclass . Ghc.ctLocOrigin $ Ghc.ctev_loc cc_ev-  , [arg] <- cc_tyargs+  | Ghc.CDictCan' di_ev di_cls di_tys <- ct+  , Ghc.getName (showClass names) == Ghc.getName di_cls+  , hasShowLevSuperclass . Ghc.ctLocOrigin $ Ghc.ctev_loc di_ev+  , [arg] <- di_tys   = Just (arg, ct)   | otherwise = Nothing   where