[Haskell-cafe] copy-on-write monad?

Greg Meredith lgreg.meredith at biosimilarity.com
Fri Jun 22 18:10:28 EDT 2007

Fellow Functionally-Caffeinated,

i have a few questions regarding copy-on-write semantics. i am working for a
client that is stuck with a legacy in-house language that chose
copy-on-write as a way to provide aliasing-issue-free semantics to a user
population they perceived as not sophisticated in programming. Despite the
fact that they are now realizing there are a lot of very sophisticated and
performant ways of providing ways to avoid aliasing problems, they are stuck
having to support copy-on-write for legacy codes.

So, i have two basic questions. First, has anyone worked out a monadic
approach to copy-on-write? (And, Is there any analysis of perf
characteristics of said monadic schemes?)

Second, i have worked out a scheme which is like a version control system.
The mutable collection is treated like a source tree. A reference to a
mutable collection is like a tag for a branch of the tree. Updates attach
deltas to a given branch of the tree. Accesses have to be matched to see if
they are impacted by any update-deltas. There is an
optimization/memo-ization strategy in which certain events (access or
update) trigger a copy to be made, finally, and the updates applied to the
copy. This shifts perf characteristics so that access becomes slower and
update considerably faster in the common case. Does anyone know if such a
scheme has been studied? i'd like to compare implementations, too, if

Best wishes,


L.G. Meredith
Managing Partner
Biosimilarity LLC
505 N 72nd St
Seattle, WA 98103

+1 206.650.3740

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20070622/ab15b4a0/attachment.htm

More information about the Haskell-Cafe mailing list