(a -> m b) -> m a -> mb
Same as >>=, but with the arguments interchanged.
When you want to acquire a resource, do some work with it, and then release the resource, it is a good idea to use bracket, because bracket will install the necessary exception handler to release the resource in the event that an exception is raised during the computation. If an exception is raised, then bracket will re-raise the exception (after performing the release).
A common example is opening a file:
> bracket
> (openFile "filename" ReadMode)
> (hClose)
> (\fileHandle -> do { ... })
The arguments to bracket are in this order so that we can partially apply it, e.g.:
> withFile name mode = bracket (openFile name mode) hClose
When you want to acquire a resource, do some work with it, and then release the resource, it is a good idea to use bracket, because bracket will install the necessary exception handler to release the resource in the event that an exception is raised during the computation. If an exception is raised, then bracket will re-raise the exception (after performing the release).
A common example is opening a file:
> bracket
> (openFile "filename" ReadMode)
> (hClose)
> (\handle -> do { ... })
The arguments to bracket are in this order so that we can partially apply it, e.g.:
> withFile name mode = bracket (openFile name mode) hClose
Like bracket, but only performs the final action if there was an exception raised by the in-between computation.
Like bracket, but only performs the final action if there was an exception raised by the in-between computation.
Map a function over a list and concatenate the results.
Right-to-left Kleisli composition of monads. (>=>), with the arguments flipped
Left-to-right Kleisli composition of monads.
Map a function over all the elements of a container and concatenate the resulting lists.
Sequential function application. The argument is evaluated using the given strategy before it is given to the function.
Parallel function application. The argument is evaluated using the given strategy, in parallel with the function application.
Evaluate a value using the given strategy. This is simply using with arguments reversed.
evaluate a value using the given Strategy. This is simply using with the arguments reversed.
Evaluate a value using the given Strategy.
> x `using` s = runEval (s x)
Evaluate a value using the given strategy.
Map each element of a structure to an action, evaluate these actions from left to right, and ignore the results.
Show more results