Neil Mitchell wrote:
Hi
In response to Neil: why use `unsafePerformIO` rather than IO exceptions
here? I think you're asking for more trouble...
Are you referring to ioError? My knowledge of exceptions in Haskell is
limited.
The error architecture is often a long way from the IO monad, so
whatever we do can't require the IO monad.
Yes - the example was in the IO monad so I thought you could use IO exceptions.
In any case, I don't recommend using 'error' (or indeed 'unsafePerformIO') for
errors you report to the user, purely because of its non-deterministic
semantics. If you use a suitable error monad or IO exceptions, you can be sure
that you'll get the same behaviour regardless of compiler or optimisation settings.
Cheers,
Simon
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs