Remove GHC.Err import from Data.Maybe

Simon Peyton-Jones simonpj at microsoft.com
Fri Jan 4 04:33:40 EST 2008


| > The trouble is that 'error' calls an I/O function to print its message, and the I/O functions in turn depend
| on a *lot* of stuff. So 'error' can be defined only when a lot of other functions have been defined.


| Why is this necessary in post-exceptions Haskell?  Can we not just have
| error be:
|
| error str = throw# (ErrorCall str)

Good point!  ('error' used to call unsafePerformIO . print, but doesn't any more)


However, the Exception type (defined in GHC.IOBase) mentions many other types at the moment.  And in fact GHC.Err depends on GHC.Exception, which depends on GHC.IOBase, so the loop is already tied in more or less the place you suggest.  (My earlier remarks wer misleading.)


However, if we had Simon's new extensible-exception mechanism, we might be in better shape.  It's silly that Exception depends on so much goop.

Simon



More information about the Cvs-ghc mailing list