Hoogle Search

Within LTS Haskell 24.2 (ghc-9.10.2)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. module Control.Monad.Trans.Resource

    Allocate resources which are guaranteed to be released. For more information, see https://github.com/snoyberg/conduit/tree/master/resourcet#readme. One point to note: all register cleanup actions live in the IO monad, not the main monad. This allows both more efficient code, and for monads to be transformed.

  2. data ResourceCleanupException

    resourcet Control.Monad.Trans.Resource

    Thrown when one or more cleanup functions themselves throw an exception during cleanup.

  3. ResourceCleanupException :: !Maybe SomeException -> SomeException -> [SomeException] -> ResourceCleanupException

    resourcet Control.Monad.Trans.Resource

    No documentation available.

  4. data ResourceT (m :: Type -> Type) a

    resourcet Control.Monad.Trans.Resource

    The Resource transformer. This transformer keeps track of all registered actions, and calls them upon exit (via runResourceT). Actions may be registered via register, or resources may be allocated atomically via allocate. allocate corresponds closely to bracket. Releasing may be performed before exit via the release function. This is a highly recommended optimization, as it will ensure that scarce resources are freed early. Note that calling release will deregister the action, so that a release action will only ever be called once. Since 0.3.0

  5. data ResourceCleanupException

    resourcet Control.Monad.Trans.Resource.Internal

    Thrown when one or more cleanup functions themselves throw an exception during cleanup.

  6. ResourceCleanupException :: !Maybe SomeException -> SomeException -> [SomeException] -> ResourceCleanupException

    resourcet Control.Monad.Trans.Resource.Internal

    No documentation available.

  7. newtype ResourceT (m :: Type -> Type) a

    resourcet Control.Monad.Trans.Resource.Internal

    The Resource transformer. This transformer keeps track of all registered actions, and calls them upon exit (via runResourceT). Actions may be registered via register, or resources may be allocated atomically via allocate. allocate corresponds closely to bracket. Releasing may be performed before exit via the release function. This is a highly recommended optimization, as it will ensure that scarce resources are freed early. Note that calling release will deregister the action, so that a release action will only ever be called once. Since 0.3.0

  8. ResourceT :: (IORef ReleaseMap -> m a) -> ResourceT (m :: Type -> Type) a

    resourcet Control.Monad.Trans.Resource.Internal

    No documentation available.

  9. resourceForkIO :: forall (m :: Type -> Type) . MonadUnliftIO m => ResourceT m () -> ResourceT m ThreadId

    resourcet Control.Monad.Trans.Resource

    Launch a new reference counted resource context using forkIO. This is defined as resourceForkWith forkIO. Note: Using regular forkIO inside of a ResourceT is inherently unsafe, since the forked thread may try access the resources of the parent after they are cleaned up. When you use resourceForkIO or resourceForkWith, ResourceT is made aware of the new thread, and will only cleanup resources when all threads finish. Other concurrency mechanisms, like concurrently or race, are safe to use. If you encounter InvalidAccess exceptions ("The mutable state is being accessed after cleanup"), use of forkIO is a possible culprit.

  10. resourceForkWith :: forall (m :: Type -> Type) a . MonadUnliftIO m => (IO () -> IO a) -> ResourceT m () -> ResourceT m a

    resourcet Control.Monad.Trans.Resource

    Introduce a reference-counting scheme to allow a resource context to be shared by multiple threads. Once the last thread exits, all remaining resources will be released. The first parameter is a function which will be used to create the thread, such as forkIO or async. Note that abuse of this function will greatly delay the deallocation of registered resources. This function should be used with care. A general guideline: If you are allocating a resource that should be shared by multiple threads, and will be held for a long time, you should allocate it at the beginning of a new ResourceT block and then call resourceForkWith from there.

Page 1 of many | Next