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

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to