In this example, there is no real difference between the two orders. The reason is that, unlike many transformers, including ExceptT , the resource transformer does not "enter" its own actions into the base monad to which you apply it, but rather begin the whole action by passing the links to the release.
If you write out types (I will refer to MaybeT instead of ExceptT for simplicity, they are obviously equivalent for this question), then you have basically
type MaybeResourceT ma = MaybeT (IORef RelMap -> ma) = IORef RelMap -> m (Maybe a) type ResourceMaybeT ma = ResourceT (m (Maybe a)) = IORef RelMap -> m (Maybe a)
i.e. actually equivalent types. I suppose you could also show this for operations.
source share