summaryrefslogtreecommitdiff
path: root/ghc
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2020-04-24 08:45:25 +0100
committerMatthew Pickering <matthewtpickering@gmail.com>2020-04-24 08:45:25 +0100
commit00a8ad780165bceca2e4268f67efe0667e5922bf (patch)
tree187170227b9b4ecf391e30d2020ef219d0437e3c /ghc
parenteaed0a3289e4c24ff1a70c6fc4b7f8bae6cd2dd3 (diff)
downloadhaskell-wip/open-telemetry.tar.gz
Diffstat (limited to 'ghc')
-rw-r--r--ghc/GHCi/UI/Monad.hs5
-rw-r--r--ghc/Main.hs3
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