polysemy-zoo-0.4.0.0: Experimental, user-contributed effects and interpreters for polysemy

Safe HaskellNone
LanguageHaskell2010

Polysemy.Final.Resource

Synopsis

Documentation

runResourceFinal :: Member (Final IO) r => Sem (Resource ': r) a -> Sem r a Source #

Run a Resource effect in terms of bracket through final IO

This can be used as an alternative to runResourceInIO

Beware: Effects that aren't interpreted in terms of IO will have local state semantics in regards to Resource effects interpreted this way. See interpretFinal.

Notably, unlike runResourceBase, this is not consistent with State unless runStateInIORef is used. State that seems like it should be threaded globally throughout brackets will not be.

Prefer runResourceBase unless its unsafe or inefficient in the context of your application.