Hi!

On Mon, Nov 15, 2010 at 9:07 PM, C. McCann <[email protected]> wrote:
> Isn't this mostly a reimplementation of mapM? Given a list of [IO
> Growable], you map over it to put a bracket around each one, then
> sequence the result

No. There is a trick. It stacks up attach and deattach. So if for
third attach something fails then both deattach for second and first
nerve is called. In your example this would not happen.

So the idea is that in a case of an error all computations (which are
of some type class which defines necessary prepare and cleanup
functions) are "unwinded". In a case of success the resulting list is
returned.


Mitar
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to