bracket

bracket :: IO a -> (a -> IO b) -> (a -> IO c) -> IO c
base Control.Exception.Base, base Control.Exception
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
bracket :: IO a -> (a -> IO b) -> (a -> IO c) -> IO c
base Control.OldException
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
bracket_ :: IO a -> IO b -> IO c -> IO c
base Control.Exception.Base, base Control.Exception, base Control.OldException
A variant of bracket computation is not required.
bracketOnError :: IO a -> (a -> IO b) -> (a -> IO c) -> IO c
base Control.Exception.Base, base Control.Exception
Like bracket, but only performs the final action if there was an exception raised by the in-between computation.
bracketOnError :: IO a -> (a -> IO b) -> (a -> IO c) -> IO c
base Control.OldException
Like bracket, but only performs the final action if there was an exception raised by the in-between computation.
brackets :: Doc -> Doc
pretty Text.PrettyPrint.HughesPJ, pretty Text.PrettyPrint
brackets :: Doc -> Doc
template-haskell Language.Haskell.TH.PprLib
Wrap document in [...]
brackets :: GenTokenParser s u m -> forall a. ParsecT s u m a -> ParsecT s u m a
parsec Text.Parsec.Token, parsec Text.ParserCombinators.Parsec.Token
Lexeme parser brackets p parses p enclosed in brackets ('[' and ']'), returning the value of p.