ANN: H98 FFI Addendum 1.0, Release Candidate 10

Simon Peyton-Jones simonpj@microsoft.com
Fri, 6 Jun 2003 09:32:18 +0100


| Or maybe it would be better to provide some useful guidance? How
about,
|=20
| 	To preserve the soundness of the type system, the result of
| 	unsafePerformIO should always have a monomorphic type. For
| 	example,
|=20
| 		listRef =3D unsafePerformIO (newIORef [])
|=20
| 	is unsafe, while
|=20
| 		listRef =3D unsafePerformIO (newIORef ([] :: [Int]))
|=20
| 	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