arendsee / rmonad

Pipelines you can compute on
70 stars 0 forks source link

Caching in data that have reference semantics #18

Open arendsee opened 6 years ago

arendsee commented 6 years ago

How should rmonad handle mutable data?

For example, if an environment is stored in rmonad, say as the head node in an Rmonad object, and then the environment is altered outside the rmonad pipeline, then the Rmonad object is changed as well. Or worse, data cached somewhere deeper inside an rmonad pipeline could be altered if it is mutable.

I could possibly fix this problem by making deep copies (clones) of mutable objects. However, this is slow and may violate expectations.

Or perhaps I should just leave rmonad as is and post a warning about the use of mutable data in rmonad pipelines?