[Haskell-cafe] What unsafeInterleaveIO is unsafe

Jake McArthur jake at pikewerks.com
Mon Mar 16 10:55:59 EDT 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Yusaku Hashimoto wrote:
| I was studying about what unsafeInterleaveIO is.I understood
| unsafeInterleaveIO takes an IO action, and delays it. But I couldn't
| find any reason why unsafeInterleaveIO is unsafe.

I think it depends on what we want to take "unsafe" to mean. In my
opinion, the word "unsafe" should really only be used in cases where
using the function can case an otherwise well-typed program to not be
well-typed. I'm pretty sure I haven't yet seen a case where this applies
to unsafeInterleaveIO.

The biggest problem with unsafeInterleaveIO is that it complicates the
semantics of the IO monad.

- - Jake
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkm+aH8ACgkQye5hVyvIUKkOygCghyHD90TdvCBR5V815fxmQbIy
mKsAnjnAgtZ5jV1p1P2St5NB2li587lU
=PzqF
-----END PGP SIGNATURE-----


More information about the Haskell-Cafe mailing list