Flix polymorphic effects

I've seen at least a few libraries already that assume purity GitHub - nikomatsakis/mutable: Tinkering with a more ergonomic cell abstraction and GitHub - salsa-rs/salsa: A generic framework for on-demand, incrementalized computation. Inspired by adapton, glimmer, and rustc's query system.

from the README of the first,

"Pure" operations

A key assumption of the library is that operations like Clone, Hash, and Eq are, in practice, "pure" -- meaning that they do not mutate any mutable cells. We can't actually know that this is true, however, so we enforce the constraint with a light-weight dynamic check. Thus, if you write a Clone impl which mutates the data in one of the types from this library (e.g., a Mut<T> or MutVec<T> ), you will get panics. Reading data from a Mut<T> etc should be fine though.