Remove GHC.Err import from Data.Maybe

Stefan O'Rear stefanor at cox.net
Fri Jan 4 15:25:19 EST 2008


On Fri, Jan 04, 2008 at 09:33:40AM +0000, Simon Peyton-Jones wrote:
> | > 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.

If a little bit of evil in the name of simplifying the build is OK, it
would also be possible to have a:

data DummyException = A | B | C | D | E | F | G | H | I | ErrorCallDummy String

(although come to think of it, this sounds little better than hs-boot
files...)

Stefan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org/pipermail/cvs-ghc/attachments/20080104/378e6e85/attachment.bin


More information about the Cvs-ghc mailing list