summaryrefslogtreecommitdiff
path: root/compiler/utils/Maybes.hs
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2016-09-12 14:54:30 -0400
committerBen Gamari <ben@smart-cactus.org>2016-09-15 09:19:50 -0400
commit626db8f82e734e48eef5ce7676a5233f98fe7145 (patch)
treeddbb493a24e2565b4f756c6c8ef97a832c4e0bee /compiler/utils/Maybes.hs
parent912384535d2ac7452d3bcda34cdee238e30600c9 (diff)
downloadhaskell-626db8f82e734e48eef5ce7676a5233f98fe7145.tar.gz
Unify CallStack handling in ghc
Here we introduce compatibility wrappers for HasCallStack constraints. This is necessary as we must support GHC 7.10.1 which lacks sane call stack support. We also introduce another constraint synonym, HasDebugCallStack, which only provides a call stack when DEBUG is set.
Diffstat (limited to 'compiler/utils/Maybes.hs')
-rw-r--r--compiler/utils/Maybes.hs8
1 files changed, 2 insertions, 6 deletions
diff --git a/compiler/utils/Maybes.hs b/compiler/utils/Maybes.hs
index b400fa6b32..89dd5b4fae 100644
--- a/compiler/utils/Maybes.hs
+++ b/compiler/utils/Maybes.hs
@@ -1,6 +1,7 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE KindSignatures #-}
+{-# LANGUAGE FlexibleContexts #-}
{-
(c) The University of Glasgow 2006
@@ -26,12 +27,7 @@ import Control.Monad
import Control.Monad.Trans.Maybe
import Control.Exception (catch, SomeException(..))
import Data.Maybe
-#if __GLASGOW_HASKELL__ >= 800
-import GHC.Stack
-#else
-import GHC.Exts (Constraint)
-type HasCallStack = (() :: Constraint)
-#endif
+import Util (HasCallStack)
infixr 4 `orElse`