proposal: add 'unsafeCoerce'

Donald Bruce Stewart dons at
Mon Nov 20 08:48:59 EST 2006

> Casting boxed types to unboxed types or vice versa is pretty much 
> guaranteed to end in tears.

Ah, you forget the 2004 IOHCC ;)

    module Main where{import GHC.Base;(&)=unsafeCoerce#;main=print(tail

    $ ./a.out
    "just a simple functional language"

Admittedly, I took about 3 days to find an example that didn't end in
segf^h^h^h^htears.. :)

-- Don

P.S. And it seems this only ever compiled with a snapshot of ghc 6.3.

More information about the Libraries mailing list