3 ms·
> I guess you need IO to run anything at all Its a bit more that that. You need to be in IO in order to catch an exception. That is to say, if you have: b
by gizmo686 6y ago
> I guess you need IO to run anything at all
Its a bit more that that. You need to be in IO in order to catch an exception.
That is to say, if you have:
bam :: (Int, Int) -> String
There is no way to write:
bam (x,y) = "bar" if x is called first
"baz" if y is called first.
However, if you were to instead have:
bam :: (Int,Int) -> IO String
Such a function is possible to write, as you can now catch the exception and do something with it.
- a1369209993 6y agoFair enough [edit: distinction to make], but the problem is still the existence of exceptions (at least as something that doesn't always terminate the process, but that's implied by most useful definitions of "exception" anyway), not anything that would be true of a hypothetical alternate version of Haskell that still had IO, but didn't have exceptions.