RE: ANN: H98 FFI Addendum 1.0, Release Candidate 10
| Or maybe it would be better to provide some useful guidance? How about, | | To preserve the soundness of the type system, the result of | unsafePerformIO should always have a monomorphic type. For | example, | | listRef = unsafePerformIO (newIORef []) | | is unsafe, while | | listRef = unsafePerformIO (newIORef ([] :: [Int])) | | is type safe. In the first case listRef is assigned type IORef | [a], which makes it possible to store a list of one type and fetch | it with a different type. Yes! Yes! Advice is good! Simon
On Fri, Jun 06, 2003 at 09:32:18AM +0100, Simon Peyton-Jones wrote:
Yes! Yes! Advice is good!
OK, how about "avoid unsafePerformIO like the plague"? Why is it the business of the FFI spec to document unsafe uses of unsafePerformIO?
On Fri, Jun 06, 2003 at 09:32:18AM +0100, Simon Peyton-Jones wrote:
Yes! Yes! Advice is good!
OK, how about "avoid unsafePerformIO like the plague"?
Why is it the business of the FFI spec to document unsafe uses of unsafePerformIO?
I'd like to second Ross here. Advice is good at the right place at the right time. Cheers, Ralf
participants (3)
-
Ralf Hinze -
Ross Paterson -
Simon Peyton-Jones