summaryrefslogtreecommitdiff
path: root/compiler/utils
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2019-01-24 11:53:03 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2019-01-24 11:53:03 +0000
commit5917d0ad24c27f0086db6692e486704b0d110540 (patch)
treea5a73ab2c127421e5a0aaaa7a8a93e9e18df82ff /compiler/utils
parent886ddb27bfbbb52c41690cd29e2ab3ed80bf5450 (diff)
downloadhaskell-wip/T15952-2.tar.gz
WIP: make a smart mkAppTyMwip/T15952-2
This branch, wip/T15952-2, is WIP on the idea of making a monadic mkAppTyM that ensures the Purely Kinded Invariant. Needs comments etc. But it validates all but one test!
Diffstat (limited to 'compiler/utils')
-rw-r--r--compiler/utils/Outputable.hs6
-rw-r--r--compiler/utils/Outputable.hs-boot3
2 files changed, 6 insertions, 3 deletions
diff --git a/compiler/utils/Outputable.hs b/compiler/utils/Outputable.hs
index bb3b9d3177..68a189f3c0 100644
--- a/compiler/utils/Outputable.hs
+++ b/compiler/utils/Outputable.hs
@@ -1199,7 +1199,7 @@ pprTraceException heading doc =
pprSTrace :: HasCallStack => SDoc -> a -> a
pprSTrace doc = pprTrace "" (doc $$ callStackDoc)
-warnPprTrace :: Bool -> String -> Int -> SDoc -> a -> a
+warnPprTrace :: HasCallStack => Bool -> String -> Int -> SDoc -> a -> a
-- ^ Just warn about an assertion failure, recording the given file and line number.
-- Should typically be accessed with the WARN macros
warnPprTrace _ _ _ _ x | not debugIsOn = x
@@ -1207,7 +1207,9 @@ warnPprTrace _ _file _line _msg x
| hasNoDebugOutput unsafeGlobalDynFlags = x
warnPprTrace False _file _line _msg x = x
warnPprTrace True file line msg x
- = pprDebugAndThen unsafeGlobalDynFlags trace heading msg x
+ = pprDebugAndThen unsafeGlobalDynFlags trace heading
+ (msg $$ callStackDoc )
+ x
where
heading = hsep [text "WARNING: file", text file <> comma, text "line", int line]
diff --git a/compiler/utils/Outputable.hs-boot b/compiler/utils/Outputable.hs-boot
index ad7d091833..fb3c173a33 100644
--- a/compiler/utils/Outputable.hs-boot
+++ b/compiler/utils/Outputable.hs-boot
@@ -1,11 +1,12 @@
module Outputable where
import GhcPrelude
+import GHC.Stack( HasCallStack )
data SDoc
showSDocUnsafe :: SDoc -> String
-warnPprTrace :: Bool -> String -> Int -> SDoc -> a -> a
+warnPprTrace :: HasCallStack => Bool -> String -> Int -> SDoc -> a -> a
text :: String -> SDoc