Skip to content
Snippets Groups Projects
  • Michael Sloan's avatar
    7258f41b
    Add PlainPanic for throwing exceptions without depending on pprint · 7258f41b
    Michael Sloan authored and Ben Gamari's avatar Ben Gamari committed
    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
    
    (cherry picked from commit fe9034e9)
    7258f41b
    History
    Add PlainPanic for throwing exceptions without depending on pprint
    Michael Sloan authored and Ben Gamari's avatar Ben Gamari committed
    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
    
    (cherry picked from commit fe9034e9)
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
ghc.cabal.in 13.73 KiB