
14 Jan
2013
14 Jan
'13
6:28 p.m.
On Mon, Jan 14, 2013 at 3:18 PM, Evan Laforge
I assume it would change from "doesn't compile" to "works" if you add the required import. It's the same as the FFI thing, right? If you don't import M (T(..)), then 'foreign ... :: T -> IO ()' gives an error, but import it and coerces T to its underlying type (hopefully that's a C type).
This is what I thought Simon meant. If so, I don't think it's a good idea, as adding the import removes a compiler error in favor of a runtime error. If the programmer really wanted to do something this unsafe, she should use unsafeCoerce.