In #haskell, is there a version of "bracket" that works on lists? Say I give it a list [a] and "acquire :: a -> IO b" as well as "release :: a -> IO c" and it'll try to acquire "IO [b]" and if one of the acquires fails, rolls back the already acquired resources?
I could fiddle around with resourcet, but is that the only option? For now, my custom-made function for this makes me uneasy. 🥲
@pmidden foldr your list into a series of `bracket open close` actions with the base case being your actual multi-bracketed code.