flaw-base-0.1.0.0

LicenseMIT
Safe HaskellSafe
LanguageHaskell2010

Flaw.Book

Description

 
Synopsis

Documentation

freeBook :: Book -> IO () Source #

Free the book.

releaseBook :: Book -> IO (IO ()) Source #

Return IO action freeing everything, and clear the book. Returned action captures state of the book at the moment of call, so it won't free resources added after.

newDynamicBook :: IO (Book, IO ()) Source #

Create a dynamic book which could be safely freed multiple times.

book :: Book -> IO (a, IO ()) -> IO a Source #

withBook :: (Book -> IO a) -> IO a Source #

withSpecialBook :: (Book -> IO a) -> IO (a, IO ()) Source #

Helper method for dealing with possible exceptions during construction of objects. User function uses separate book for construction, and if exception is thrown, book got freed.