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. bracketInputEcho :: IO a -> IO a

    echo 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)
    

  2. brackets :: Parser a -> Parser a

    graphql Language.GraphQL.AST.Lexer

    Parser for an expression between "[" and "]".

  3. bracketOnError :: MonadPeelIO m => m a -> (a -> m b) -> (a -> m c) -> m c

    monad-peel Control.Exception.Peel

    Generalized version of bracketOnError.

  4. bracket_ :: MonadPeelIO m => m a -> m b -> m c -> m c

    monad-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.

  5. bracketHandler :: IO a -> (a -> IO x) -> (a -> Handler b v c) -> Handler b v c

    snap 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.

    1. Normal completion
    2. Short-circuit completion, either from calling fail or finishWith
    3. An exception being thrown.

  6. bracketIO :: forall (m :: Type -> Type) b c a . (MonadIO m, MonadCatch m) => IO b -> (b -> IO c) -> (b -> Stream m a) -> Stream m a

    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

  7. bracketIO3 :: forall (m :: Type -> Type) b c d e a . (MonadIO m, MonadCatch m) => IO b -> (b -> IO c) -> (b -> IO d) -> (b -> IO e) -> (b -> Stream m a) -> Stream m a

    streamly-core Streamly.Data.Stream

    Like bracketIO but can use 3 separate cleanup actions depending on the mode of termination:

    1. When the stream stops normally
    2. When the stream is garbage collected
    3. When the stream encounters an exception
    bracketIO3 before onStop onGC onException action runs action using the result of before. If the stream stops, onStop action is executed, if the stream is abandoned onGC is executed, if the stream encounters an exception onException is executed. The exception is not caught, it is rethrown. Inhibits stream fusion Pre-release

  8. bracketIO :: forall (m :: Type -> Type) b c a . (MonadIO m, MonadCatch m) => IO b -> (b -> IO c) -> (b -> StreamK m a) -> StreamK m a

    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)
    

  9. bracketIO :: forall (m :: Type -> Type) b c a . (MonadIO m, MonadCatch m) => IO b -> (b -> IO c) -> (b -> Stream m a) -> Stream m a

    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

  10. bracketIO3 :: forall (m :: Type -> Type) b c d e a . (MonadIO m, MonadCatch m) => IO b -> (b -> IO c) -> (b -> IO d) -> (b -> IO e) -> (b -> Stream m a) -> Stream m a

    streamly-core Streamly.Internal.Data.Stream

    Like bracketIO but can use 3 separate cleanup actions depending on the mode of termination:

    1. When the stream stops normally
    2. When the stream is garbage collected
    3. When the stream encounters an exception
    bracketIO3 before onStop onGC onException action runs action using the result of before. If the stream stops, onStop action is executed, if the stream is abandoned onGC is executed, if the stream encounters an exception onException is executed. The exception is not caught, it is rethrown. Inhibits stream fusion Pre-release

Page 15 of many | Previous | Next