Everything that Johan Tibell said + you may be interested in the
resourcet package [1] (which is used by conduit to handle resources).
Cheers,
[1] http://hackage.haskell.org/package/resourcet
> _______________________________________________> `Control.Exception.bracket` is a nice function to acquire and release a
> resource in a small context.
>
> But, how should I handle resources that are hold for a long time?
>
> Should I put `Control.Exception.finally` on every single line of my
> finalizers?
> What exceptions may occur on an IO operation?
> Every IO function has the risk of throwing an exception?
>
> Thanks,
> Thiago.
>
>
> Haskell-Cafe mailing list
> Haskell-Cafe@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
--
Felipe.