Looking at the haskellforall I found something which should be interesting in my case A type dedicated to this sort of problem. the Resource Monad. I will investigate :) thanks Frederic [1] http://www.haskellforall.com/2013/06/the-resource-applicative.html