[GHC] #14730: Missing predicate for "ResourceVanished" IOException/IOErrorType

GHC ghc-devs at haskell.org
Sat Jan 27 20:15:19 UTC 2018


#14730: Missing predicate for "ResourceVanished" IOException/IOErrorType
-------------------------------------+-------------------------------------
           Reporter:  bit            |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:                 |           Version:  8.2.2
  libraries/base                     |
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 `IOErrorType` has a "`ResourceVanished`" constructor:
 https://hackage.haskell.org/package/base-4.10.1.0/docs/src/GHC.IO.Exception.html#IOErrorType

 But there is no way to detect this for an `IOException` or `IOErrorType`.

 Here is some real-world code I found, where the author wants to catch
 "`ResourceVanished`", but resorts to catching all `IOException`:
 https://hackage.haskell.org/package/http-client-tls-0.3.5.1/docs/src
 /Network-HTTP-Client-TLS.html#convertConnection

 Docs for `hPutBuf` also mention the public existence of
 "`ResourceVanished`":
 https://hackage.haskell.org/package/base-4.10.1.0/docs/GHC-IO-
 Handle.html#v:hPutBuf

 Suggestion:

 We need to add functions:

 {{{#!haskell
 isResourceVanished :: IOError -> Bool

 resourceVanishedErrorType :: IOErrorType

 isResourceVanishedErrorType :: IOErrorType -> Bool
 }}}

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


More information about the ghc-tickets mailing list