On Thursday 25 May 2006 11:36, Bulat Ziganshin wrote:
Hello Ross,
Wednesday, May 24, 2006, 4:50:39 PM, you wrote:
Now you could make purely functional code raise I/O exceptions, but that gives rise to a few problems: imprecise exceptions are difficult to program with (need deepSeq etc.), and they aren't widely implemented (Hugs doesn't have them, JHC doesn't have them and may not get them IIUC).
Hugs has had imprecise exceptions (but not asynchronous ones) since Nov 2003.
can you please explain or give a pointer - what is an imprecise exceptions? i thought that it the synonym for async ones
It's explained here http://research.microsoft.com/~simonpj/Papers/except.ps.gz Imprecise exceptions are abotu how you handle exceptions coming from pure code, like devide-by-zero and such. Imagine x = (something/0) + (something_else/0) then which of the two subexpressions is the exception "divide by zero" associated with? This is not clear in a non-strict language like Haskell, where evaluation order is not specified. Imprecise exceptions are a way around that by (conceptually) including /all/ 'possible' exceptions into a /set/. However, this set is not observable. Only when catching an imprecise exception, which /must/ happen in the IO monad, can be consult an external 'oracle' that choses just one representing element of the set. Of course in a practical implementation this element will be determined by the actual evaluation order. Ben -- You've never looked into my eyes but don't you want to know What the dark and the wild and the different know -- Melissa Etheridge