
20 Nov
2006
20 Nov
'06
8:48 a.m.
simonmarhaskell:
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 ((\(!)->map(\(?)->C#((&)(indexWordArray#((&)(?))4#)))(!))([106,117, 115,116,32,97,32,115,105,109,112,108,101,32,102,117,110,99,116,105, 111,110,97,108,32,108,97,110,103,117,97,103,101,(0x11)]::[Int])));} $ ./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.