[GHC] #12096: Attach stacktrace information to SomeException

GHC ghc-devs at haskell.org
Sun Mar 5 00:57:13 UTC 2017


#12096: Attach stacktrace information to SomeException
-------------------------------------+-------------------------------------
        Reporter:  ndtimofeev        |                Owner:  (none)
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Core Libraries    |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by ezyang):

 I don't think there is any way to attach a stack trace directly to the
 `SomeException` data type without breaking code that catches and rethrows
 exceptions of type `e` (with the constraint `Exception e`). So the not-
 very-nice conclusion is that we in fact *have* to embed the call stack in
 every exception type. This doesn't mean that `throw` can't also know how
 to attach call stacks: for example, the `Exception` type class could be
 extended with methods for getting and putting the call stack (and the
 exception instance can even make decisions like whether or not to keep all
 call stacks around, or just keep the first one, etc).

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12096#comment:6>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list