[GHC] #5902: Cannot tell from an exception handler whether the exception was asynchronous

GHC ghc-devs at haskell.org
Wed Jul 17 21:06:03 CEST 2013


#5902: Cannot tell from an exception handler whether the exception was
asynchronous
-------------------------------------+------------------------------------
        Reporter:  simonmar          |            Owner:  simonmar
            Type:  bug               |           Status:  new
        Priority:  normal            |        Milestone:  7.8.1
       Component:  Compiler          |          Version:  7.4.1
      Resolution:                    |         Keywords:
Operating System:  Unknown/Multiple  |     Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown      |       Difficulty:  Unknown
       Test Case:                    |       Blocked By:
        Blocking:                    |  Related Tickets:
-------------------------------------+------------------------------------

Comment (by exbb2):

 Replying to [comment:9 igloo]:
 > If we had
 > {{{
 > newCatch :: Exception e => IO a -> ((e, Bool{- async? -}) -> IO a) -> IO
 a
 > newCatch = ... primitive ...
 >
 > newThrow :: Exception e => (e, Bool) -> a
 > newThrow (e, async) = if async then do t <- myThreadId
 >                                        throwTo t e
 >                                else throw e
 > }}}
 > then would using `newCatch` and `newThrow` in place of `catch` and
 `throw` solve the problem? (at the expense of having this annoying `Bool`
 getting in the way, and making the code less pretty).

 I've had that design for quite some time now, I'm unsure if there's
 another sensible solution, except magically tagging the exception values
 themselves, but that could only complicate things.

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




More information about the ghc-tickets mailing list