Hoogle Search

Within LTS Haskell 24.4 (ghc-9.10.2)

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

  1. bracket :: forall (es :: Effects) a b . Eff es a -> (a -> Eff es ()) -> (a -> Eff es b) -> Eff es b

    bluefin Bluefin.Eff

    bracket acquire release body: acquire a resource, perform the body with it, and release the resource even if body threw an exception. This is essentially the same as Control.Exception.bracket, whose documentation you can inspect for further details. bracket has a very general type that does not require es to contain an exception or IO effect. The reason that this is safe is:

    • While bracket does catch exceptions, this is unobservable, since the exception is re-thrown; the cleanup action happens unconditionally; and no part of it gets access to the thrown exception.
    • Eff itself is able to guarantee that any exceptions thrown in the body will be actually thrown before bracket exits. This is inherited from the fact that Eff is a wrapper around IO.
    While it is usually the case that the cleanup action will in fact want to use IO effects, this is not universally true, see the polymorphicBracket example for an example.

  2. bracket :: MonadUnliftIO m => m a -> (a -> m b) -> (a -> m c) -> m c

    classy-prelude-yesod ClassyPrelude.Yesod

    Allocate and clean up a resource safely. For more information on motivation and usage of this function, see base's bracket. This function has two differences from the one in base. The first, and more obvious, is that it works on any MonadUnliftIO instance, not just IO. The more subtle difference is that this function will use uninterruptible masking for its cleanup handler. This is a subtle distinction, but at a high level, means that resource cleanup has more guarantees to complete. This comes at the cost that an incorrectly written cleanup function cannot be interrupted. For more information, please see https://github.com/fpco/safe-exceptions/issues/3.

  3. bracket :: forall (r :: EffectRow) a c b . Member Resource r => Sem r a -> (a -> Sem r c) -> (a -> Sem r b) -> Sem r b

    incipit-core IncipitCore

    Allocate a resource, use it, and clean it up afterwards.

  4. bracket :: (HasCallStack, MonadMask m) => m a -> (a -> m c) -> (a -> m b) -> m b

    jsaddle-dom JSDOM

    Generalized abstracted pattern of safe resource acquisition and release in the face of errors. The first action "acquires" some value, which is "released" by the second action at the end. The third action "uses" the value and its result is the result of the bracket. If an error is thrown during the use, the release still happens before the error is rethrown. Note that this is essentially a type-specialized version of generalBracket. This function has a more common signature (matching the signature from Control.Exception), and is often more convenient to use. By contrast, generalBracket is more expressive, allowing us to implement other functions like bracketOnError.

  5. bracket :: Unexceptional m => UIO a -> (a -> UIO ()) -> (a -> UIO c) -> m c

    unexceptionalio-trans UnexceptionalIO.Trans

    When you're doing resource handling, PseudoException matters. You still need to use the bracket pattern to handle cleanup.

  6. data Bracket l

    haskell-src-exts Language.Haskell.Exts.Syntax

    A template haskell bracket expression.

  7. Bracket :: forall (m :: Type -> Type) a1 c a . m a1 -> (a1 -> m c) -> (a1 -> m a) -> Resource m a

    polysemy Polysemy.Resource

    Allocate a resource, use it, and clean it up afterwards.

  8. type Bracket = Bracket ()

    haskell-src-exts-simple Language.Haskell.Exts.Simple.Syntax

    No documentation available.

  9. Bracket :: Expr -> Expr -> Expr

    language-glsl Language.GLSL.Syntax

    No documentation available.

  10. bracketOnError :: IO a -> (a -> IO b) -> (a -> IO c) -> IO c

    base Control.Exception

    Like bracket, but only performs the final action if there was an exception raised by the in-between computation.

Page 5 of many | Previous | Next