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.
bracketInputEcho :: IO a -> IO aecho System.IO.Echo.Internal Save the terminal's current input EchoState, perform a computation, restore the saved EchoState, and then return the result of the computation.
bracketInputEcho action = bracket getInputEchoState setInputEchoState (const action)
brackets :: Parser a -> Parser agraphql Language.GraphQL.AST.Lexer Parser for an expression between "[" and "]".
bracketOnError :: MonadPeelIO m => m a -> (a -> m b) -> (a -> m c) -> m cmonad-peel Control.Exception.Peel Generalized version of bracketOnError.
bracket_ :: MonadPeelIO m => m a -> m b -> m c -> m cmonad-peel Control.Exception.Peel Generalized version of bracket_. Note, any monadic side effects in m of both the "acquire" and "release" computations will be discarded. To keep the monadic side effects of the "acquire" computation, use bracket with constant functions instead.
bracketHandler :: IO a -> (a -> IO x) -> (a -> Handler b v c) -> Handler b v csnap Snap.Snaplet This function brackets a Handler action in resource acquisition and release. Like bracketSnap, this is provided because MonadCatchIO's bracket function doesn't work properly in the case of a short-circuit return from the action being bracketed. In order to prevent confusion regarding the effects of the aquisition and release actions on the Handler state, this function doesn't accept Handler actions for the acquire or release actions. This function will run the release action in all cases where the acquire action succeeded. This includes the following behaviors from the bracketed Snap action.
- Normal completion
- Short-circuit completion, either from calling fail or finishWith
- An exception being thrown.
-
streamly-core Streamly.Data.Stream Run the alloc action IO b with async exceptions disabled but keeping blocking operations interruptible (see mask). Use the output b of the IO action as input to the function b -> Stream m a to generate an output stream. b is usually a resource under the IO monad, e.g. a file handle, that requires a cleanup after use. The cleanup action b -> IO c, runs whenever (1) the stream ends normally, (2) due to a sync or async exception or, (3) if it gets garbage collected after a partial lazy evaluation. The exception is not caught, it is rethrown. bracketIO only guarantees that the cleanup action runs, and it runs with async exceptions enabled. The action must ensure that it can successfully cleanup the resource in the face of sync or async exceptions. When the stream ends normally or on a sync exception, cleanup action runs immediately in the current thread context, whereas in other cases it runs in the GC context, therefore, cleanup may be delayed until the GC gets to run. An example where GC based cleanup happens is when a stream is being folded but the fold terminates without draining the entire stream or if the consumer of the stream encounters an exception. Observes exceptions only in the stream generation, and not in stream consumers. See also: bracketUnsafe Inhibits stream fusion
-
streamly-core Streamly.Data.Stream Like bracketIO but can use 3 separate cleanup actions depending on the mode of termination:
- When the stream stops normally
- When the stream is garbage collected
- When the stream encounters an exception
-
streamly-core Streamly.Data.StreamK Like Streamly.Data.Stream.bracketIO but with one significant difference, this function observes exceptions from the consumer of the stream as well. Therefore, it cleans up the resource promptly when the consumer encounters an exception. You can also convert StreamK to Stream and use resource handling from Stream module:
>>> bracketIO bef aft bet = StreamK.fromStream $ Stream.bracketIO bef aft (StreamK.toStream . bet)
-
streamly-core Streamly.Internal.Data.Stream Run the alloc action IO b with async exceptions disabled but keeping blocking operations interruptible (see mask). Use the output b of the IO action as input to the function b -> Stream m a to generate an output stream. b is usually a resource under the IO monad, e.g. a file handle, that requires a cleanup after use. The cleanup action b -> IO c, runs whenever (1) the stream ends normally, (2) due to a sync or async exception or, (3) if it gets garbage collected after a partial lazy evaluation. The exception is not caught, it is rethrown. bracketIO only guarantees that the cleanup action runs, and it runs with async exceptions enabled. The action must ensure that it can successfully cleanup the resource in the face of sync or async exceptions. When the stream ends normally or on a sync exception, cleanup action runs immediately in the current thread context, whereas in other cases it runs in the GC context, therefore, cleanup may be delayed until the GC gets to run. An example where GC based cleanup happens is when a stream is being folded but the fold terminates without draining the entire stream or if the consumer of the stream encounters an exception. Observes exceptions only in the stream generation, and not in stream consumers. See also: bracketUnsafe Inhibits stream fusion
-
streamly-core Streamly.Internal.Data.Stream Like bracketIO but can use 3 separate cleanup actions depending on the mode of termination:
- When the stream stops normally
- When the stream is garbage collected
- When the stream encounters an exception