Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what's the point of System.IO.Error

I noticed there is a IOException type in Control.Exception as well, what's the point of having a separate System.IO.Error module and IOError type? Is it there just because of historical reasons? Should I avoid using it and prefer Control.Exception.IOException?

like image 862
swang Avatar asked May 18 '14 23:05

swang


People also ask

How do I fix an IO error?

At times, an outdated driver may also cause an I/O device error. This error can be fixed by updating or re-installing a new driver. You need to check whether the drivers are updated and compatible with the disk transfer.

What causes IO error in Windows 10?

Input/Output device errors are quite common. They're usually a hardware issue, such as a faulty cable, a glitch with your hard drive or SSD, or a misconfigured driver.

What is an IO device error USB?

What is an I/O error? I/O device error stands for Input-Output Error and it occurs when the OS is not able to perform an input-output action making the flash drive inaccessible. It affects the read - write functionalities of USB drives.

What is IO read error?

Hello Andrie; The I/O stands for Input / Output and if you are getting a Read error it means that your computer is unable to read from where the info is, and could be the beginning of some real problems, and should be checked out.


2 Answers

Yes, it is just for historical reasons.

System.IO.Error has an IOError type which is just a type synonym for IOException (in GHC anyways).

GHCs fancy exception hierarchy mechanism is not part of the Haskell standard. So, IOError is used for compatability with Haskell 2010.

If you are happy with being GHC specific, IOException and the entire Exception hierarchy is simply better and should be preferred.

like image 58
Philip JF Avatar answered Oct 20 '22 05:10

Philip JF


IOError is the old Haskell98 IO exception type. Control.Exception and other newer variants are not necessarily Haskell98-compatible, but we can embed the old Haskell98 errors in them, hence the type synonym.

like image 29
Don Stewart Avatar answered Oct 20 '22 04:10

Don Stewart