Add PlainPanic for throwing exceptions without depending on pprint

Authored by mgsloan on Mar 14 2019, 5:47 PM.

Description

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.

  1. 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 Trac #13101

Details

Committed
mpickeringMay 24 2019, 10:55 AM
Parents
rGHCc931f2561207: Allow metric change after reverting "Add Generic tuple instances up to 15…
Branches
Unknown
Tags
Unknown