-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | <tt>lifted-base</tt> exports IO operations from the base library
--   lifted to any instance of <a>MonadBase</a> or <a>MonadBaseControl</a>.
--   
--   Note that not all modules from <tt>base</tt> are converted yet. If you
--   need a lifted version of a function from <tt>base</tt>, just ask me to
--   add it or send me a patch.
--   
--   The package includes a copy of the <tt>monad-peel</tt> testsuite
--   written by Anders Kaseorg The tests can be performed using <tt>cabal
--   test</tt>.
@package lifted-base
@version 0.2.3.12


-- | This is a wrapped version of <a>Control.Concurrent.Chan</a> with types
--   generalised from <a>IO</a> to all monads in <a>MonadBase</a>.
--   
--   <a>unGetChan</a> and <a>isEmptyChan</a> are deprecated in
--   <tt>base</tt>, therefore they are not included here. Use <a>TVar</a>
--   instead.
module Control.Concurrent.Chan.Lifted
data Chan a

-- | Generalized version of <a>newChan</a>.
newChan :: MonadBase IO m => m (Chan a)

-- | Generalized version of <a>writeChan</a>.
writeChan :: MonadBase IO m => Chan a -> a -> m ()

-- | Generalized version of <a>readChan</a>.
readChan :: MonadBase IO m => Chan a -> m a

-- | Generalized version of <a>dupChan</a>.
dupChan :: MonadBase IO m => Chan a -> m (Chan a)

-- | Generalized version of <a>getChanContents</a>.
getChanContents :: MonadBase IO m => Chan a -> m [a]

-- | Generalized version of <a>writeList2Chan</a>.
writeList2Chan :: MonadBase IO m => Chan a -> [a] -> m ()


-- | This is a wrapped version of <a>Control.Concurrent.MVar</a> with types
--   generalized from <a>IO</a> to all monads in either <a>MonadBase</a> or
--   <a>MonadBaseControl</a>.
module Control.Concurrent.MVar.Lifted
data MVar a

-- | Generalized version of <a>newEmptyMVar</a>.
newEmptyMVar :: MonadBase IO m => m (MVar a)

-- | Generalized version of <a>newMVar</a>.
newMVar :: MonadBase IO m => a -> m (MVar a)

-- | Generalized version of <a>takeMVar</a>.
takeMVar :: MonadBase IO m => MVar a -> m a

-- | Generalized version of <a>putMVar</a>.
putMVar :: MonadBase IO m => MVar a -> a -> m ()

-- | Generalized version of <a>readMVar</a>.
readMVar :: MonadBase IO m => MVar a -> m a

-- | Generalized version of <a>swapMVar</a>.
swapMVar :: MonadBase IO m => MVar a -> a -> m a

-- | Generalized version of <a>tryTakeMVar</a>.
tryTakeMVar :: MonadBase IO m => MVar a -> m (Maybe a)

-- | Generalized version of <a>tryPutMVar</a>.
tryPutMVar :: MonadBase IO m => MVar a -> a -> m Bool

-- | Generalized version of <a>isEmptyMVar</a>.
isEmptyMVar :: MonadBase IO m => MVar a -> m Bool

-- | Generalized version of <a>withMVar</a>.
withMVar :: MonadBaseControl IO m => MVar a -> (a -> m b) -> m b

-- | Generalized version of <a>modifyMVar_</a>.
modifyMVar_ :: MonadBaseControl IO m => MVar a -> (a -> m a) -> m ()

-- | Generalized version of <a>modifyMVar</a>.
modifyMVar :: MonadBaseControl IO m => MVar a -> (a -> m (a, b)) -> m b

-- | Generalized version of <a>modifyMVarMasked_</a>.
modifyMVarMasked_ :: MonadBaseControl IO m => MVar a -> (a -> m a) -> m ()

-- | Generalized version of <a>modifyMVarMasked</a>.
modifyMVarMasked :: MonadBaseControl IO m => MVar a -> (a -> m (a, b)) -> m b

-- | Generalized version of <a>mkWeakMVar</a>.
--   
--   Note any monadic side effects in <tt>m</tt> of the "finalizer"
--   computation are discarded.
mkWeakMVar :: MonadBaseControl IO m => MVar a -> m () -> m (Weak (MVar a))

-- | Generalized version of <a>withMVarMasked</a>.
withMVarMasked :: MonadBaseControl IO m => MVar a -> (a -> m b) -> m b

-- | Generalized version of <a>tryReadMVar</a>.
tryReadMVar :: MonadBase IO m => MVar a -> m (Maybe a)


-- | This is a wrapped version of <a>Control.Concurrent.QSem</a> with types
--   generalised from <a>IO</a> to all monads in <a>MonadBase</a>.
module Control.Concurrent.QSem.Lifted
data QSem

-- | Generalized version of <a>newQSem</a>.
newQSem :: MonadBase IO m => Int -> m QSem

-- | Generalized version of <a>waitQSem</a>.
waitQSem :: MonadBase IO m => QSem -> m ()

-- | Generalized version of <a>signalQSem</a>.
signalQSem :: MonadBase IO m => QSem -> m ()


-- | This is a wrapped version of <a>Control.Concurrent.QSemN</a> with
--   types generalised from <a>IO</a> to all monads in <a>MonadBase</a>.
module Control.Concurrent.QSemN.Lifted
data QSemN

-- | Generalized version of <a>newQSemN</a>.
newQSemN :: MonadBase IO m => Int -> m QSemN

-- | Generalized version of <a>waitQSemN</a>.
waitQSemN :: MonadBase IO m => QSemN -> Int -> m ()

-- | Generalized version of <a>signalQSemN</a>.
signalQSemN :: MonadBase IO m => QSemN -> Int -> m ()


-- | This is a wrapped version of <a>Control.Exception</a> with types
--   generalized from <a>IO</a> to all monads in either <a>MonadBase</a> or
--   <a>MonadBaseControl</a>.
module Control.Exception.Lifted
assert :: Bool -> a -> a
mapException :: (Exception e1, Exception e2) => (e1 -> e2) -> a -> a
tryWithContext :: Exception e => IO a -> IO (Either (ExceptionWithContext e) a)
throw :: forall a e. (HasCallStack, Exception e) => e -> a
addExceptionContext :: ExceptionAnnotation a => a -> SomeException -> SomeException
someExceptionContext :: SomeException -> ExceptionContext
annotateIO :: ExceptionAnnotation e => e -> IO a -> IO a
catchNoPropagate :: Exception e => IO a -> (ExceptionWithContext e -> IO a) -> IO a
interruptible :: IO a -> IO a
rethrowIO :: Exception e => ExceptionWithContext e -> IO a
asyncExceptionFromException :: Exception e => SomeException -> Maybe e
asyncExceptionToException :: Exception e => e -> SomeException
data NestedAtomically
NestedAtomically :: NestedAtomically
newtype NoMethodError
NoMethodError :: String -> NoMethodError
data NonTermination
NonTermination :: NonTermination
newtype PatternMatchFail
PatternMatchFail :: String -> PatternMatchFail
newtype RecConError
RecConError :: String -> RecConError
newtype RecSelError
RecSelError :: String -> RecSelError
newtype RecUpdError
RecUpdError :: String -> RecUpdError
newtype TypeError
TypeError :: String -> TypeError
data ErrorCall
ErrorCall :: String -> ErrorCall
pattern ErrorCallWithLocation :: String -> String -> ErrorCall
data ArithException
Overflow :: ArithException
Underflow :: ArithException
LossOfPrecision :: ArithException
DivideByZero :: ArithException
Denormal :: ArithException
RatioZeroDenominator :: ArithException
class (Typeable e, Show e) => Exception e
toException :: Exception e => e -> SomeException
fromException :: Exception e => SomeException -> Maybe e
displayException :: Exception e => e -> String
backtraceDesired :: Exception e => e -> Bool
data ExceptionWithContext a
ExceptionWithContext :: ExceptionContext -> a -> ExceptionWithContext a
newtype NoBacktrace e
NoBacktrace :: e -> NoBacktrace e
data SomeException
SomeException :: e -> SomeException
data WhileHandling
WhileHandling :: SomeException -> WhileHandling
data MaskingState
Unmasked :: MaskingState
MaskedInterruptible :: MaskingState
MaskedUninterruptible :: MaskingState
data AllocationLimitExceeded
AllocationLimitExceeded :: AllocationLimitExceeded
data ArrayException
IndexOutOfBounds :: String -> ArrayException
UndefinedElement :: String -> ArrayException
newtype AssertionFailed
AssertionFailed :: String -> AssertionFailed
data AsyncException
StackOverflow :: AsyncException
HeapOverflow :: AsyncException
ThreadKilled :: AsyncException
UserInterrupt :: AsyncException
data BlockedIndefinitelyOnMVar
BlockedIndefinitelyOnMVar :: BlockedIndefinitelyOnMVar
data BlockedIndefinitelyOnSTM
BlockedIndefinitelyOnSTM :: BlockedIndefinitelyOnSTM
newtype CompactionFailed
CompactionFailed :: String -> CompactionFailed
data Deadlock
Deadlock :: Deadlock
data IOException
data SomeAsyncException
SomeAsyncException :: e -> SomeAsyncException

-- | Generalized version of <a>throwIO</a>.
throwIO :: (MonadBase IO m, Exception e) => e -> m a

-- | Generalized version of <a>ioError</a>.
ioError :: MonadBase IO m => IOError -> m a

-- | Generalized version of <a>throwTo</a>.
throwTo :: (MonadBase IO m, Exception e) => ThreadId -> e -> m ()

-- | Generalized version of <a>catch</a>.
--   
--   Note, when the given computation throws an exception any monadic side
--   effects in <tt>m</tt> will be discarded.
catch :: (MonadBaseControl IO m, Exception e) => m a -> (e -> m a) -> m a

-- | Generalized version of <a>catches</a>.
--   
--   Note, when the given computation throws an exception any monadic side
--   effects in <tt>m</tt> will be discarded.
catches :: MonadBaseControl IO m => m a -> [Handler m a] -> m a

-- | Generalized version of <a>Handler</a>.
data Handler (m :: Type -> Type) a
Handler :: (e -> m a) -> Handler (m :: Type -> Type) a

-- | Generalized version of <a>catchJust</a>.
--   
--   Note, when the given computation throws an exception any monadic side
--   effects in <tt>m</tt> will be discarded.
catchJust :: (MonadBaseControl IO m, Exception e) => (e -> Maybe b) -> m a -> (b -> m a) -> m a

-- | Generalized version of <a>handle</a>.
--   
--   Note, when the given computation throws an exception any monadic side
--   effects in <tt>m</tt> will be discarded.
handle :: (MonadBaseControl IO m, Exception e) => (e -> m a) -> m a -> m a

-- | Generalized version of <a>handleJust</a>.
--   
--   Note, when the given computation throws an exception any monadic side
--   effects in <tt>m</tt> will be discarded.
handleJust :: (MonadBaseControl IO m, Exception e) => (e -> Maybe b) -> (b -> m a) -> m a -> m a

-- | Generalized version of <a>try</a>.
--   
--   Note, when the given computation throws an exception any monadic side
--   effects in <tt>m</tt> will be discarded.
try :: (MonadBaseControl IO m, Exception e) => m a -> m (Either e a)

-- | Generalized version of <a>tryJust</a>.
--   
--   Note, when the given computation throws an exception any monadic side
--   effects in <tt>m</tt> will be discarded.
tryJust :: (MonadBaseControl IO m, Exception e) => (e -> Maybe b) -> m a -> m (Either b a)

-- | Generalized version of <a>evaluate</a>.
evaluate :: MonadBase IO m => a -> m a

-- | Generalized version of <a>mask</a>.
mask :: MonadBaseControl IO m => ((forall a. () => m a -> m a) -> m b) -> m b

-- | Generalized version of <a>mask_</a>.
mask_ :: MonadBaseControl IO m => m a -> m a

-- | Generalized version of <a>uninterruptibleMask</a>.
uninterruptibleMask :: MonadBaseControl IO m => ((forall a. () => m a -> m a) -> m b) -> m b

-- | Generalized version of <a>uninterruptibleMask_</a>.
uninterruptibleMask_ :: MonadBaseControl IO m => m a -> m a

-- | Generalized version of <a>getMaskingState</a>.
getMaskingState :: MonadBase IO m => m MaskingState

-- | Generalized version of <a>allowInterrupt</a>.
allowInterrupt :: MonadBase IO m => m ()

-- | Generalized version of <a>bracket</a>.
--   
--   Note:
--   
--   <ul>
--   <li>When the "acquire" or "release" computations throw exceptions any
--   monadic side effects in <tt>m</tt> will be discarded.</li>
--   <li>When the "in-between" computation throws an exception any monadic
--   side effects in <tt>m</tt> produced by that computation will be
--   discarded but the side effects of the "acquire" or "release"
--   computations will be retained.</li>
--   <li>Also, any monadic side effects in <tt>m</tt> of the "release"
--   computation will be discarded; it is run only for its side effects in
--   <tt>IO</tt>.</li>
--   </ul>
--   
--   Note that when your <tt>acquire</tt> and <tt>release</tt> computations
--   are of type <a>IO</a> it will be more efficient to write:
--   
--   <pre>
--   <tt>liftBaseOp</tt> (<a>bracket</a> acquire release)
--   </pre>
bracket :: MonadBaseControl IO m => m a -> (a -> m b) -> (a -> m c) -> m c

-- | Generalized version of <a>bracket_</a>.
--   
--   Note any monadic side effects in <tt>m</tt> of <i>both</i> the
--   "acquire" and "release" computations will be discarded. To keep the
--   monadic side effects of the "acquire" computation, use <a>bracket</a>
--   with constant functions instead.
--   
--   Note that when your <tt>acquire</tt> and <tt>release</tt> computations
--   are of type <a>IO</a> it will be more efficient to write:
--   
--   <pre>
--   <a>liftBaseOp_</a> (<a>bracket_</a> acquire release)
--   </pre>
bracket_ :: MonadBaseControl IO m => m a -> m b -> m c -> m c

-- | Generalized version of <a>bracketOnError</a>.
--   
--   Note:
--   
--   <ul>
--   <li>When the "acquire" or "release" computations throw exceptions any
--   monadic side effects in <tt>m</tt> will be discarded.</li>
--   <li>When the "in-between" computation throws an exception any monadic
--   side effects in <tt>m</tt> produced by that computation will be
--   discarded but the side effects of the "acquire" computation will be
--   retained.</li>
--   <li>Also, any monadic side effects in <tt>m</tt> of the "release"
--   computation will be discarded; it is run only for its side effects in
--   <tt>IO</tt>.</li>
--   </ul>
--   
--   Note that when your <tt>acquire</tt> and <tt>release</tt> computations
--   are of type <a>IO</a> it will be more efficient to write:
--   
--   <pre>
--   <tt>liftBaseOp</tt> (<a>bracketOnError</a> acquire release)
--   </pre>
bracketOnError :: MonadBaseControl IO m => m a -> (a -> m b) -> (a -> m c) -> m c

-- | Generalized version of <a>finally</a>.
--   
--   Note, any monadic side effects in <tt>m</tt> of the "afterward"
--   computation will be discarded.
finally :: MonadBaseControl IO m => m a -> m b -> m a

-- | Generalized version of <a>onException</a>.
--   
--   Note, any monadic side effects in <tt>m</tt> of the "afterward"
--   computation will be discarded.
onException :: MonadBaseControl IO m => m a -> m b -> m a


-- | This is a wrapped version of <a>Control.Concurrent</a> with types
--   generalized from <a>IO</a> to all monads in either <a>MonadBase</a> or
--   <a>MonadBaseControl</a>.
module Control.Concurrent.Lifted
data ThreadId

-- | Generalized version of <a>myThreadId</a>.
myThreadId :: MonadBase IO m => m ThreadId

-- | Generalized version of <a>forkIO</a>.
--   
--   Note that, while the forked computation <tt>m ()</tt> has access to
--   the captured state, all its side-effects in <tt>m</tt> are discarded.
--   It is run only for its side-effects in <a>IO</a>.
fork :: MonadBaseControl IO m => m () -> m ThreadId

-- | Generalized version of <a>forkIOWithUnmask</a>.
--   
--   Note that, while the forked computation <tt>m ()</tt> has access to
--   the captured state, all its side-effects in <tt>m</tt> are discarded.
--   It is run only for its side-effects in <a>IO</a>.
forkWithUnmask :: MonadBaseControl IO m => ((forall a. () => m a -> m a) -> m ()) -> m ThreadId

-- | Generalized version of <a>forkFinally</a>.
--   
--   Note that in <tt>forkFinally action and_then</tt>, while the forked
--   <tt>action</tt> and the <tt>and_then</tt> function have access to the
--   captured state, all their side-effects in <tt>m</tt> are discarded.
--   They're run only for their side-effects in <a>IO</a>.
forkFinally :: MonadBaseControl IO m => m a -> (Either SomeException a -> m ()) -> m ThreadId

-- | Generalized version of <a>killThread</a>.
killThread :: MonadBase IO m => ThreadId -> m ()

-- | Generalized version of <a>throwTo</a>.
throwTo :: (MonadBase IO m, Exception e) => ThreadId -> e -> m ()

-- | Generalized version of <a>forkOn</a>.
--   
--   Note that, while the forked computation <tt>m ()</tt> has access to
--   the captured state, all its side-effects in <tt>m</tt> are discarded.
--   It is run only for its side-effects in <a>IO</a>.
forkOn :: MonadBaseControl IO m => Int -> m () -> m ThreadId

-- | Generalized version of <a>forkOnWithUnmask</a>.
--   
--   Note that, while the forked computation <tt>m ()</tt> has access to
--   the captured state, all its side-effects in <tt>m</tt> are discarded.
--   It is run only for its side-effects in <a>IO</a>.
forkOnWithUnmask :: MonadBaseControl IO m => Int -> ((forall a. () => m a -> m a) -> m ()) -> m ThreadId

-- | Generalized version of <a>getNumCapabilities</a>.
getNumCapabilities :: MonadBase IO m => m Int

-- | Generalized version of <a>setNumCapabilities</a>.
setNumCapabilities :: MonadBase IO m => Int -> m ()

-- | Generalized version of <a>threadCapability</a>.
threadCapability :: MonadBase IO m => ThreadId -> m (Int, Bool)

-- | Generalized version of <a>yield</a>.
yield :: MonadBase IO m => m ()

-- | Generalized version of <a>threadDelay</a>.
threadDelay :: MonadBase IO m => Int -> m ()

-- | Generalized version of <a>threadWaitRead</a>.
threadWaitRead :: MonadBase IO m => Fd -> m ()

-- | Generalized version of <a>threadWaitWrite</a>.
threadWaitWrite :: MonadBase IO m => Fd -> m ()
rtsSupportsBoundThreads :: Bool

-- | Generalized version of <a>forkOS</a>.
--   
--   Note that, while the forked computation <tt>m ()</tt> has access to
--   the captured state, all its side-effects in <tt>m</tt> are discarded.
--   It is run only for its side-effects in <a>IO</a>.
forkOS :: MonadBaseControl IO m => m () -> m ThreadId

-- | Generalized version of <a>isCurrentThreadBound</a>.
isCurrentThreadBound :: MonadBase IO m => m Bool

-- | Generalized version of <a>runInBoundThread</a>.
runInBoundThread :: MonadBaseControl IO m => m a -> m a

-- | Generalized version of <a>runInUnboundThread</a>.
runInUnboundThread :: MonadBaseControl IO m => m a -> m a

-- | Generalized versio of <a>mkWeakThreadId</a>.
mkWeakThreadId :: MonadBase IO m => ThreadId -> m (Weak ThreadId)


-- | This is a wrapped version of <a>Data.IORef</a> with types generalised
--   from <a>IO</a> to all monads in <a>MonadBase</a>.
module Data.IORef.Lifted
data IORef a

-- | Generalized version of <a>newIORef</a>.
newIORef :: MonadBase IO m => a -> m (IORef a)

-- | Generalized version of <a>readIORef</a>.
readIORef :: MonadBase IO m => IORef a -> m a

-- | Generalized version of <a>writeIORef</a>.
writeIORef :: MonadBase IO m => IORef a -> a -> m ()

-- | Generalized version of <a>modifyIORef</a>.
modifyIORef :: MonadBase IO m => IORef a -> (a -> a) -> m ()

-- | Generalized version of <a>modifyIORef'</a>.
modifyIORef' :: MonadBase IO m => IORef a -> (a -> a) -> m ()

-- | Generalized version of <a>atomicModifyIORef</a>.
atomicModifyIORef :: MonadBase IO m => IORef a -> (a -> (a, b)) -> m b

-- | Generalized version of <a>atomicModifyIORef'</a>.
atomicModifyIORef' :: MonadBase IO m => IORef a -> (a -> (a, b)) -> m b

-- | Generalized version of <a>atomicWriteIORef</a>.
atomicWriteIORef :: MonadBase IO m => IORef a -> a -> m ()

-- | Generalized version of <a>mkWeakIORef</a>.
--   
--   Note any monadic side effects in <tt>m</tt> of the "finalizer"
--   computation are discarded.
mkWeakIORef :: MonadBaseControl IO m => IORef a -> m () -> m (Weak (IORef a))


-- | This is a wrapped version of <a>Foreign.Marshal.Utils</a> with types
--   generalized from <a>IO</a> to all monads in either <tt>MonadBase</tt>
--   or <a>MonadBaseControl</a>.
module Foreign.Marshal.Utils.Lifted

-- | Generalized version of <a>with</a>.
--   
--   Note, when the given function throws an exception any monadic side
--   effects in <tt>m</tt> will be discarded.
with :: (MonadBaseControl IO m, Storable a) => a -> (Ptr a -> m b) -> m b


-- | Attach a timeout event to monadic computations which are instances of
--   <a>MonadBaseControl</a>.
module System.Timeout.Lifted

-- | Generalized version of <a>timeout</a>.
--   
--   Note that when the given computation times out any side effects of
--   <tt>m</tt> are discarded. When the computation completes within the
--   given time the side-effects are restored on return.
timeout :: MonadBaseControl IO m => Int -> m a -> m (Maybe a)
