summaryrefslogtreecommitdiff
path: root/compiler/utils/StringBuffer.hs
diff options
context:
space:
mode:
authorMichael Sloan <mgsloan@gmail.com>2019-03-14 15:47:44 -0700
committerMatthew Pickering <matthewtpickering@gmail.com>2019-05-24 16:55:07 +0100
commitd9dfbde30aa11afc87f25b73dc2d154a46ca24d4 (patch)
tree6a8172d4cbbbeb1533e3ca8146a107938e9ae173 /compiler/utils/StringBuffer.hs
parentc931f2561207aa06f1750827afbb68fbee241c6f (diff)
downloadhaskell-d9dfbde30aa11afc87f25b73dc2d154a46ca24d4.tar.gz
Add PlainPanic for throwing exceptions without depending on pprint
This commit splits out a subset of GhcException which do not depend on pretty printing (SDoc), as a new datatype called PlainGhcException. These exceptions can be caught as GhcException, because 'fromException' will convert them. The motivation for this change is that that the Panic module transitively depends on many modules, primarily due to pretty printing code. It's on the order of about 130 modules. This large set of dependencies has a few implications: 1. To avoid cycles / use of boot files, these dependencies cannot throw GhcException. 2. There are some utility modules that use UnboxedTuples and also use `panic`. This means that when loading GHC into GHCi, about 130 additional modules would need to be compiled instead of interpreted. Splitting the non-pprint exception throwing into a new module resolves this issue. See #13101
Diffstat (limited to 'compiler/utils/StringBuffer.hs')
-rw-r--r--compiler/utils/StringBuffer.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/utils/StringBuffer.hs b/compiler/utils/StringBuffer.hs
index 64578bffde..98b8c19340 100644
--- a/compiler/utils/StringBuffer.hs
+++ b/compiler/utils/StringBuffer.hs
@@ -50,7 +50,7 @@ import GhcPrelude
import Encoding
import FastString
import FastFunctions
-import Outputable
+import PlainPanic
import Util
import Data.Maybe