DDC compiler and effects; better than Haskell? (was Re: [Haskell-cafe] unsafeDestructiveAssign?)

Sebastian Sylvan sebastian.sylvan at gmail.com
Fri Aug 14 22:21:54 EDT 2009

On Fri, Aug 14, 2009 at 9:41 PM, John A. De Goes <john at n-brain.net> wrote:

> Hmmm, my point (perhaps I wasn't clear), is that different effects have
> different commutability properties. In the case of a file system, you can
> commute two sequential reads from two different files.

But you can't! I can easily envisage a scenario where there's a link between
two pieces of data in two different files, where it's okay if the data in
file A is "newer" (in a versioning sense, not a timestamp sense) than the
corresponding data in file B, but the opposite doesn't hold. So if you have
another program writing that data it will write first to A, and then to B.
The program reading this *must* then read the files in the correct order (B
then A, to ensure the data from A is always newer or at the same "version"
as the data in B).

Anytime you talk to the outside world, there may be implicit ordering that
you need to respect, so I really think that needs to be serialized.
Of course, there may be things in the IO monad that doesn't talk to the
outside world that could be commutative.

Sebastian Sylvan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090814/22d6f479/attachment.html

More information about the Haskell-Cafe mailing list