diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2020-04-24 08:45:25 +0100 |
---|---|---|
committer | Matthew Pickering <matthewtpickering@gmail.com> | 2020-04-24 08:45:25 +0100 |
commit | 00a8ad780165bceca2e4268f67efe0667e5922bf (patch) | |
tree | 187170227b9b4ecf391e30d2020ef219d0437e3c /ghc | |
parent | eaed0a3289e4c24ff1a70c6fc4b7f8bae6cd2dd3 (diff) | |
download | haskell-wip/open-telemetry.tar.gz |
Open telemwip/open-telemetry
Diffstat (limited to 'ghc')
-rw-r--r-- | ghc/GHCi/UI/Monad.hs | 5 | ||||
-rw-r--r-- | ghc/Main.hs | 3 |
2 files changed, 6 insertions, 2 deletions
diff --git a/ghc/GHCi/UI/Monad.hs b/ghc/GHCi/UI/Monad.hs index 27e31b6cf6..04da5e0c57 100644 --- a/ghc/GHCi/UI/Monad.hs +++ b/ghc/GHCi/UI/Monad.hs @@ -35,6 +35,7 @@ module GHCi.UI.Monad ( #include "HsVersions.h" +import Control.Monad.Catch (MonadMask) import GHCi.UI.Info (ModInfo) import qualified GHC import GHC.Driver.Monad hiding (liftIO) @@ -273,7 +274,7 @@ instance Applicative GHCi where instance Monad GHCi where (GHCi m) >>= k = GHCi $ \s -> m s >>= \a -> unGHCi (k a) s -class GhcMonad m => GhciMonad m where +class (MonadMask m, GhcMonad m) => GhciMonad m where getGHCiState :: m GHCiState setGHCiState :: GHCiState -> m () modifyGHCiState :: (GHCiState -> GHCiState) -> m () @@ -320,6 +321,7 @@ instance ExceptionMonad GHCi where in unGHCi (f g_restore) s +{- instance MonadThrow Ghc where throwM = liftIO . throwM @@ -340,6 +342,7 @@ instance MonadMask Ghc where (unGhc acquire s) (\resource exitCase -> unGhc (release resource exitCase) s) (\resource -> unGhc (use resource) s) + -} instance MonadThrow GHCi where throwM = liftIO . throwM diff --git a/ghc/Main.hs b/ghc/Main.hs index 7a356b920a..2a441bfb22 100644 --- a/ghc/Main.hs +++ b/ghc/Main.hs @@ -63,6 +63,7 @@ import Util import Panic import GHC.Types.Unique.Supply import MonadUtils ( liftIO ) +import OpenTelemetry -- Imports for --abi-hash import GHC.Iface.Load ( loadUserInterface ) @@ -98,7 +99,7 @@ import Prelude -- GHC's command-line interface main :: IO () -main = do +main = withSpan "main" $ do initGCStatistics -- See Note [-Bsymbolic and hooks] hSetBuffering stdout LineBuffering hSetBuffering stderr LineBuffering |