The Revenge of Finalizers
alastair at reid-consulting-uk.ltd.uk
Thu Oct 17 12:01:13 EDT 2002
> However in general I think we can hide some of the horribleness from
> the user:
> modify2IORefs :: IORef a -> IORef b -> (a -> b -> (a,b,c)) -> IO c
> [horrible code deleted]
And if they need to update 3 IORefs or a list of IORefs?
Writing code like that yourself and getting it right and portable
between compilers seems to be ludicrously hard.
I can't tell if that code is right (my gut says no). Worse though, I
don't even know what semantic framework to use to reason about it if
we want to be sure the code will work in the presence of strictness
analyzers, eager evaluation, parallel evaluation, fully-lazy
evaluation, etc. Operational reasoning and reasoning by example
struggle with such a task.
More information about the FFI