Skip to content

Commit

Permalink
Updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mmhat committed Aug 25, 2023
1 parent 9651b49 commit ebf0bbe
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/Effectful/Resource.hs
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,14 @@ releaseEff = unsafeEff_ . R.release

-- | A variant of 'R.unprotect' adjusted to work in the 'Eff' monad.
--
-- /Note:/ the @release@ action returned will run a clone of the environment it
-- was registered in, so the effect row @es'@ will be ignored.
unprotectEff :: (Resource :> es, Resource :> es') => R.ReleaseKey -> Eff es (Maybe (Eff es' ()))
-- /Note:/ if the resource was acquired using 'allocateEff', 'allocateEff_' or
-- 'registerEff' then the @release@ action returned will run in a clone of the
-- environment it was registered in, so the effect row @es'@ will be ignored.
-- Please see the documentation of the aforementioned functions.
unprotectEff
:: (Resource :> es, Resource :> es')
=> R.ReleaseKey
-> Eff es (Maybe (Eff es' ()))
unprotectEff = unsafeEff_ . fmap (fmap unsafeEff_) . R.unprotect

----------------------------------------
Expand Down

0 comments on commit ebf0bbe

Please sign in to comment.