On Mon, Feb 28, 2011 at 2:32 PM, Graydon Hoare <gray...@mozilla.com> wrote:
>
> A word on *that* concept might be in order: at the moment our effect system
> considers a function "pure" if it mutates local variables. Depending on your
> opinion, this might be fudging the notion of "purity" or might be capturing
> its essence without getting too annoying. So long as mutation doesn't leave
> the local frame (i.e. no writes to the heap)


FWIW even Haskell allows you to mutate the heap inside pure functions, so
long as those effects don't escape. Conceptually each call to runST creates
a new, local, heap that you can mutate to your heart's content because
nobody else can see it, and none of those effects can leak (other than
through the return value) which is enforced by some cleverness with rank-2
types.

I think that if Haskell allows it, it's unlikely to be an issue even for
purists. :-)

-- 
Sebastian Sylvan
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to