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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

-- | This is a wrapped version of Control.Exception with types
--   generalized from IO to all monads in either MonadBase or
--   MonadBaseControl.
module Control.Exception.Lifted
assert :: Bool -> a -> a
data SomeException
SomeException :: e -> SomeException
data BlockedIndefinitelyOnMVar
BlockedIndefinitelyOnMVar :: BlockedIndefinitelyOnMVar
data IOException
class (Typeable e, Show e) => Exception e
toException :: Exception e => e -> SomeException
fromException :: Exception e => SomeException -> Maybe e
displayException :: Exception e => e -> String
mapException :: (Exception e1, Exception e2) => (e1 -> e2) -> a -> a
throw :: forall (r :: RuntimeRep) (a :: TYPE r) e. Exception e => e -> a
interruptible :: IO a -> 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
ErrorCallWithLocation :: String -> String -> ErrorCall
pattern ErrorCall :: String -> ErrorCall
data ArithException
Overflow :: ArithException
Underflow :: ArithException
LossOfPrecision :: ArithException
DivideByZero :: ArithException
Denormal :: ArithException
RatioZeroDenominator :: ArithException
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 BlockedIndefinitelyOnSTM
BlockedIndefinitelyOnSTM :: BlockedIndefinitelyOnSTM
newtype CompactionFailed
CompactionFailed :: String -> CompactionFailed
data Deadlock
Deadlock :: Deadlock
data SomeAsyncException
SomeAsyncException :: e -> SomeAsyncException

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

-- | 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.
--   
--   Note that when your acquire and release computations
--   are of type IO it will be more efficient to write:
--   
--   
--   liftBaseOp_ (bracket_ acquire release)
--   
bracket_ :: MonadBaseControl IO m => m a -> m b -> m c -> m c

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

-- | Generalized version of with.
--   
--   Note, when the given function throws an exception any monadic side
--   effects in m 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
--   MonadBaseControl.
module System.Timeout.Lifted

-- | Generalized version of timeout.
--   
--   Note that when the given computation times out any side effects of
--   m 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)
