finally package:lifted-base

Generalized version of finally. Note, any monadic side effects in m of the "afterward" computation will be discarded.
Generalized version of forkFinally. Note that in forkFinally action and_then, while the forked action and the and_then function have access to the captured state, all their side-effects in m are discarded. They're run only for their side-effects in IO.