This looks like the "correct" behaviour.  What you're doing is turning
off the typechecker so that you can do something which is blatantly
incorrect.  

If you were getting similar problems with code which is obviously
"correct" but which Hindley-Milner prevents you from doing (as, for
example, the use of unsafeCoerce in the Dynamic library), I'd be
worried.

Perhaps the documentation (if there is any - I'm not sure we advertise
the existence of this function) should have a stronger warning?

[Incidentally, I'm mildly surprised that the first use returns True
and the second use fails (it doesn't on FreeBSD) - just shows you how
little I really understand of Hugs' innards.]


Alastair

> From: Conal Elliott <[EMAIL PROTECTED]>
> To: "'Alastair Reid'" <[EMAIL PROTECTED]>
> Cc: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>,
>         "Sigbjorn Finne (Intl Vendor)" <[EMAIL PROTECTED]>
> Subject: RE: unsafeCoerce strangeness 
> Date: Wed, 8 Sep 1999 13:22:05 -0700 
> X-Mailer: Internet Mail Service (5.5.2524.0)
> 
> Sorry.  I cut out too much.  Here's what happens in Hugs98:
> 
>     Rewrite> 10.0 == unsafeCoerce ()
>     True
>     Rewrite> 10 == unsafeCoerce ()

    Unexpected signal

Reply via email to