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

GHC ghc-devs at haskell.org
Wed Jul 17 19:41:52 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 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).

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




More information about the ghc-tickets mailing list