#3517: GHC has lots of extra hidden IOErrorType values
-----------------------------+----------------------------------------------
Reporter: duncan | Owner:
Type: bug | Status: new
Priority: normal | Component: libraries/base
Version: | Severity: normal
Keywords: | Testcase:
Os: Unknown/Multiple | Architecture: Unknown/Multiple
-----------------------------+----------------------------------------------
I was fixing bytestring's hGet (see #3514) and I discover that I cannot
produce the same exception as System.IO.hGet does in the same
circumstance.
There are two problems:
One is that GHC's internal IOError has more information than one can set
via System.IO.Error.mkIOError. In particular it has a function name.
The other is that System.IO.hGet throws an `InvalidArgument`
`IOErrorType`, however this is not exported and there are no smart
constructors or testers for this error type. This is problematic for two
reasons, portable code cannot generate these error types to mirror the
standard System.IO and secondly no code can actually catch these errors
except in a general "catch all" style because they cannot be distinguished
from each other.
Code that wants to mirror System.IO (like bytestring or utf8-string) has
to import GHC.IO.Exception and use cpp to do it differently for hugs and
nhc.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3517>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs