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

-- | The MonadUnliftIO typeclass for unlifting monads to IO (batteries included)
--   
--   Please see the README.md file for details.
@package unliftio
@version 0.1.1.0

-- | Unlifted System.Timeout.
module UnliftIO.Timeout

-- | Unlifted timeout.
timeout :: MonadUnliftIO m => Int -> m a -> m (Maybe a)

-- | Unlifted Control.Concurrent.MVar.
module UnliftIO.MVar

-- | An MVar (pronounced "em-var") is a synchronising variable, used
--   for communication between concurrent threads. It can be thought of as
--   a a box, which may be empty or full.
data MVar a :: * -> *

-- | Lifted newEmptyMVar.
newEmptyMVar :: MonadIO m => m (MVar a)

-- | Lifted newMVar.
newMVar :: MonadIO m => a -> m (MVar a)

-- | Lifted takeMVar.
takeMVar :: MonadIO m => MVar a -> m a

-- | Lifted putMVar.
putMVar :: MonadIO m => MVar a -> a -> m ()

-- | Lifted readMVar.
readMVar :: MonadIO m => MVar a -> m a

-- | Lifted swapMVar.
swapMVar :: MonadIO m => MVar a -> a -> m a

-- | Lifted tryTakeMVar.
tryTakeMVar :: MonadIO m => MVar a -> m (Maybe a)

-- | Lifted tryPutMVar.
tryPutMVar :: MonadIO m => MVar a -> a -> m Bool

-- | Lifted isEmptyMVar.
isEmptyMVar :: MonadIO m => MVar a -> m Bool

-- | Unlifted withMVar.
withMVar :: MonadUnliftIO m => MVar a -> (a -> m b) -> m b

-- | Unlifted withMVarMasked.
withMVarMasked :: MonadUnliftIO m => MVar a -> (a -> m b) -> m b

-- | Unlifted modifyMVar.
modifyMVar :: MonadUnliftIO m => MVar a -> (a -> m (a, b)) -> m b

-- | Unlifted modifyMVar_.
modifyMVar_ :: MonadUnliftIO m => MVar a -> (a -> m a) -> m ()

-- | Unlifted modifyMVarMasked.
modifyMVarMasked :: MonadUnliftIO m => MVar a -> (a -> m (a, b)) -> m b

-- | Unlifted modifyMVarMasked_.
modifyMVarMasked_ :: MonadUnliftIO m => MVar a -> (a -> m a) -> m ()

-- | Lifted tryReadMVar.
tryReadMVar :: MonadIO m => MVar a -> m (Maybe a)

-- | Unlifted mkWeakMVar.
mkWeakMVar :: MonadUnliftIO m => MVar a -> m () -> m (Weak (MVar a))

-- | Orphans instances.
module UnliftIO.Instances
instance Control.Monad.IO.Unlift.MonadUnliftIO m => Control.Monad.IO.Unlift.MonadUnliftIO (Control.Monad.Logger.LoggingT m)
instance Control.Monad.IO.Unlift.MonadUnliftIO m => Control.Monad.IO.Unlift.MonadUnliftIO (Control.Monad.Logger.NoLoggingT m)
instance Control.Monad.IO.Unlift.MonadUnliftIO m => Control.Monad.IO.Unlift.MonadUnliftIO (Control.Monad.Trans.Resource.Internal.ResourceT m)

-- | Unlifted Control.Monad.Trans.Resource.
module UnliftIO.Resource

-- | The Resource transformer. This transformer keeps track of all
--   registered actions, and calls them upon exit (via
--   runResourceT). Actions may be registered via
--   register, or resources may be allocated atomically via
--   allocate. allocate corresponds closely to
--   bracket.
--   
--   Releasing may be performed before exit via the release
--   function. This is a highly recommended optimization, as it will ensure
--   that scarce resources are freed early. Note that calling
--   release will deregister the action, so that a release action
--   will only ever be called once.
--   
--   Since 0.3.0
data ResourceT (m :: * -> *) a :: (* -> *) -> * -> *

-- | Unlifted version of runResourceT.
runResourceT :: MonadUnliftIO m => ResourceT m a -> m a

-- | Lifted version of liftResourceT.
liftResourceT :: MonadIO m => ResourceT IO a -> ResourceT m a

-- | Unlifted Data.IORef.
module UnliftIO.IORef

-- | A mutable variable in the IO monad
data IORef a :: * -> *

-- | Lifted newIORef.
newIORef :: MonadIO m => a -> m (IORef a)

-- | Lifted readIORef.
readIORef :: MonadIO m => IORef a -> m a

-- | Lifted writeIORef.
writeIORef :: MonadIO m => IORef a -> a -> m ()

-- | Lifted modifyIORef.
modifyIORef :: MonadIO m => IORef a -> (a -> a) -> m ()

-- | Lifted modifyIORef'.
modifyIORef' :: MonadIO m => IORef a -> (a -> a) -> m ()

-- | Lifted atomicModifyIORef.
atomicModifyIORef :: MonadIO m => IORef a -> (a -> (a, b)) -> m b

-- | Lifted atomicModifyIORef'.
atomicModifyIORef' :: MonadIO m => IORef a -> (a -> (a, b)) -> m b

-- | Lifted atomicWriteIORef.
atomicWriteIORef :: MonadIO m => IORef a -> a -> m ()

-- | Unlifted mkWeakIORef.
mkWeakIORef :: MonadUnliftIO m => IORef a -> m () -> m (Weak (IORef a))

-- | Unlifted System.IO.
module UnliftIO.IO

-- | See openFile
data IOMode :: *
ReadMode :: IOMode
WriteMode :: IOMode
AppendMode :: IOMode
ReadWriteMode :: IOMode

-- | Haskell defines operations to read and write characters from and to
--   files, represented by values of type Handle. Each value of
--   this type is a handle: a record used by the Haskell run-time
--   system to manage I/O with file system objects. A handle has at
--   least the following properties:
--   
--   
--   
- whether it manages input or output or both;
--   
- whether it is open, closed or
--   semi-closed;
--   
- whether the object is seekable;
--   
- whether buffering is disabled, or enabled on a line or block
--   basis;
--   
- a buffer (whose length may be zero).
--   
--   
--   Most handles will also have a current I/O position indicating where
--   the next input or output operation will occur. A handle is
--   readable if it manages only input or both input and output;
--   likewise, it is writable if it manages only output or both
--   input and output. A handle is open when first allocated. Once
--   it is closed it can no longer be used for either input or output,
--   though an implementation cannot re-use its storage while references
--   remain to it. Handles are in the Show and Eq classes.
--   The string produced by showing a handle is system dependent; it should
--   include enough information to identify the handle for debugging. A
--   handle is equal according to == only to itself; no attempt is
--   made to compare the internal state of different handles for equality.
data Handle :: *

-- | Unlifted version of withFile.
withFile :: MonadUnliftIO m => FilePath -> IOMode -> (Handle -> m a) -> m a

-- | Unlifted version of withBinaryFile.
withBinaryFile :: MonadUnliftIO m => FilePath -> IOMode -> (Handle -> m a) -> m a

-- | Unlifted Control.Exception, with extra async exception safety
--   and more helper functions.
module UnliftIO.Exception

-- | Synchronously throw the given exception.
throwIO :: (MonadIO m, Exception e) => e -> m a

-- | A convenience function for throwing a user error. This is useful for
--   cases where it would be too high a burden to define your own exception
--   type.
--   
--   This throws an exception of type StringException. When GHC
--   supports it (base 4.9 and GHC 8.0 and onward), it includes a call
--   stack.
throwString :: (MonadIO m, HasCallStack) => String -> m a

-- | Exception type thrown by throwString.
--   
--   Note that the second field of the data constructor depends on GHC/base
--   version. For base 4.9 and GHC 8.0 and later, the second field is a
--   call stack. Previous versions of GHC and base do not support call
--   stacks, and the field is simply unit (provided to make pattern
--   matching across GHC versions easier).
data StringException
StringException :: String -> CallStack -> StringException

-- | Smart constructor for a StringException that deals with the
--   call stack.
stringException :: HasCallStack => String -> StringException

-- | Throw an asynchronous exception to another thread.
--   
--   Synchronously typed exceptions will be wrapped into an
--   AsyncExceptionWrapper, see
--   https://github.com/fpco/safe-exceptions#determining-sync-vs-async.
--   
--   It's usually a better idea to use the UnliftIO.Async module,
--   see https://github.com/fpco/safe-exceptions#quickstart.
throwTo :: (Exception e, MonadIO m) => ThreadId -> e -> m ()

-- | Generate a pure value which, when forced, will synchronously throw the
--   given exception.
--   
--   Generally it's better to avoid using this function and instead use
--   throwIO, see
--   https://github.com/fpco/safe-exceptions#quickstart.
impureThrow :: Exception e => e -> a

-- | Unwrap an Either value, throwing its Left value as a
--   runtime exception via throwIO if present.
fromEither :: (Exception e, MonadIO m) => Either e a -> m a

-- | Same as fromEither, but works on an IO-wrapped
--   Either.
fromEitherIO :: (Exception e, MonadIO m) => IO (Either e a) -> m a

-- | Same as fromEither, but works on an m-wrapped
--   Either.
fromEitherM :: (Exception e, MonadIO m) => m (Either e a) -> m a

-- | Unlifted catch, but will not catch asynchronous exceptions.
catch :: (MonadUnliftIO m, Exception e) => m a -> (e -> m a) -> m a

-- | catch specialized to only catching IOExceptions.
catchIO :: MonadUnliftIO m => m a -> (IOException -> m a) -> m a

-- | catch specialized to catch all synchronous exception.
catchAny :: MonadUnliftIO m => m a -> (SomeException -> m a) -> m a

-- | Same as catch, but fully force evaluation of the result value
--   to find all impure exceptions.
catchDeep :: (MonadUnliftIO m, Exception e, NFData a) => m a -> (e -> m a) -> m a

-- | catchDeep specialized to catch all synchronous exception.
catchAnyDeep :: (NFData a, MonadUnliftIO m) => m a -> (SomeException -> m a) -> m a

-- | catchJust is like catch but it takes an extra argument
--   which is an exception predicate, a function which selects which type
--   of exceptions we're interested in.
catchJust :: (MonadUnliftIO m, Exception e) => (e -> Maybe b) -> m a -> (b -> m a) -> m a

-- | Flipped version of catch.
handle :: (MonadUnliftIO m, Exception e) => (e -> m a) -> m a -> m a

-- | handle specialized to only catching IOExceptions.
handleIO :: MonadUnliftIO m => (IOException -> m a) -> m a -> m a

-- | Flipped version of catchAny.
handleAny :: MonadUnliftIO m => (SomeException -> m a) -> m a -> m a

-- | Flipped version of catchDeep.
handleDeep :: (MonadUnliftIO m, Exception e, NFData a) => (e -> m a) -> m a -> m a

-- | Flipped version of catchAnyDeep.
handleAnyDeep :: (MonadUnliftIO m, NFData a) => (SomeException -> m a) -> m a -> m a

-- | Flipped catchJust.
handleJust :: (MonadUnliftIO m, Exception e) => (e -> Maybe b) -> (b -> m a) -> m a -> m a

-- | Unlifted try, but will not catch asynchronous exceptions.
try :: (MonadUnliftIO m, Exception e) => m a -> m (Either e a)

-- | try specialized to only catching IOExceptions.
tryIO :: MonadUnliftIO m => m a -> m (Either IOException a)

-- | try specialized to catch all synchronous exceptions.
tryAny :: MonadUnliftIO m => m a -> m (Either SomeException a)

-- | Same as try, but fully force evaluation of the result value to
--   find all impure exceptions.
tryDeep :: (MonadUnliftIO m, Exception e, NFData a) => m a -> m (Either e a)

-- | tryDeep specialized to catch all synchronous exceptions.
tryAnyDeep :: (MonadUnliftIO m, NFData a) => m a -> m (Either SomeException a)

-- | A variant of try that takes an exception predicate to select
--   which exceptions are caught.
tryJust :: (MonadUnliftIO m, Exception e) => (e -> Maybe b) -> m a -> m (Either b a)

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

-- | Same as upstream catches, but will not catch asynchronous
--   exceptions.
catches :: MonadUnliftIO m => m a -> [Handler m a] -> m a

-- | Same as catches, but fully force evaluation of the result value
--   to find all impure exceptions.
catchesDeep :: (MonadUnliftIO m, NFData a) => m a -> [Handler m a] -> m a

-- | Async safe version of onException.
onException :: MonadUnliftIO m => m a -> m b -> m a

-- | Async safe version of bracket.
bracket :: MonadUnliftIO m => m a -> (a -> m b) -> (a -> m c) -> m c

-- | Async safe version of bracket_.
bracket_ :: MonadUnliftIO m => m a -> m b -> m c -> m c

-- | Async safe version of finally.
finally :: MonadUnliftIO m => m a -> m b -> m a

-- | Like onException, but provides the handler the thrown
--   exception.
withException :: (MonadUnliftIO m, Exception e) => m a -> (e -> m b) -> m a

-- | Async safe version of bracketOnError.
bracketOnError :: MonadUnliftIO m => m a -> (a -> m b) -> (a -> m c) -> m c

-- | A variant of bracketOnError where the return value from the
--   first computation is not required.
bracketOnError_ :: MonadUnliftIO m => m a -> m b -> m c -> m c

-- | Wrap up an asynchronous exception to be treated as a synchronous
--   exception.
--   
--   This is intended to be created via toSyncException.
data SyncExceptionWrapper
SyncExceptionWrapper :: e -> SyncExceptionWrapper

-- | Convert an exception into a synchronous exception.
--   
--   For synchronous exceptions, this is the same as toException.
--   For asynchronous exceptions, this will wrap up the exception with
--   SyncExceptionWrapper.
toSyncException :: Exception e => e -> SomeException

-- | Wrap up a synchronous exception to be treated as an asynchronous
--   exception.
--   
--   This is intended to be created via toAsyncException.
data AsyncExceptionWrapper
AsyncExceptionWrapper :: e -> AsyncExceptionWrapper

-- | Convert an exception into an asynchronous exception.
--   
--   For asynchronous exceptions, this is the same as toException.
--   For synchronous exceptions, this will wrap up the exception with
--   AsyncExceptionWrapper.
toAsyncException :: Exception e => e -> SomeException

-- | Check if the given exception is synchronous.
isSyncException :: Exception e => e -> Bool

-- | Check if the given exception is asynchronous.
isAsyncException :: Exception e => e -> Bool

-- | Unlifted version of mask.
mask :: MonadUnliftIO m => ((forall a. m a -> m a) -> m b) -> m b

-- | Unlifted version of uninterruptibleMask.
uninterruptibleMask :: MonadUnliftIO m => ((forall a. m a -> m a) -> m b) -> m b

-- | Unlifted version of mask_.
mask_ :: MonadUnliftIO m => m a -> m a

-- | Unlifted version of uninterruptibleMask_.
uninterruptibleMask_ :: MonadUnliftIO m => m a -> m a

-- | Lifted version of evaluate.
evaluate :: MonadIO m => a -> m a

-- | Deeply evaluate a value using evaluate and NFData.
evaluateDeep :: (MonadIO m, NFData a) => a -> m a

-- | Any type that you wish to throw or catch as an exception must be an
--   instance of the Exception class. The simplest case is a new
--   exception type directly below the root:
--   
--   
--   data MyException = ThisException | ThatException
--       deriving (Show, Typeable)
--   
--   instance Exception MyException
--   
--   
--   The default method definitions in the Exception class do what
--   we need in this case. You can now throw and catch
--   ThisException and ThatException as exceptions:
--   
--   
--   *Main> throw ThisException `catch` \e -> putStrLn ("Caught " ++ show (e :: MyException))
--   Caught ThisException
--   
--   
--   In more complicated examples, you may wish to define a whole hierarchy
--   of exceptions:
--   
--   
--   ---------------------------------------------------------------------
--   -- Make the root exception type for all the exceptions in a compiler
--   
--   data SomeCompilerException = forall e . Exception e => SomeCompilerException e
--       deriving Typeable
--   
--   instance Show SomeCompilerException where
--       show (SomeCompilerException e) = show e
--   
--   instance Exception SomeCompilerException
--   
--   compilerExceptionToException :: Exception e => e -> SomeException
--   compilerExceptionToException = toException . SomeCompilerException
--   
--   compilerExceptionFromException :: Exception e => SomeException -> Maybe e
--   compilerExceptionFromException x = do
--       SomeCompilerException a <- fromException x
--       cast a
--   
--   ---------------------------------------------------------------------
--   -- Make a subhierarchy for exceptions in the frontend of the compiler
--   
--   data SomeFrontendException = forall e . Exception e => SomeFrontendException e
--       deriving Typeable
--   
--   instance Show SomeFrontendException where
--       show (SomeFrontendException e) = show e
--   
--   instance Exception SomeFrontendException where
--       toException = compilerExceptionToException
--       fromException = compilerExceptionFromException
--   
--   frontendExceptionToException :: Exception e => e -> SomeException
--   frontendExceptionToException = toException . SomeFrontendException
--   
--   frontendExceptionFromException :: Exception e => SomeException -> Maybe e
--   frontendExceptionFromException x = do
--       SomeFrontendException a <- fromException x
--       cast a
--   
--   ---------------------------------------------------------------------
--   -- Make an exception type for a particular frontend compiler exception
--   
--   data MismatchedParentheses = MismatchedParentheses
--       deriving (Typeable, Show)
--   
--   instance Exception MismatchedParentheses where
--       toException   = frontendExceptionToException
--       fromException = frontendExceptionFromException
--   
--   
--   We can now catch a MismatchedParentheses exception as
--   MismatchedParentheses, SomeFrontendException or
--   SomeCompilerException, but not other types, e.g.
--   IOException:
--   
--   
--   *Main> throw MismatchedParentheses catch e -> putStrLn ("Caught " ++ show (e :: MismatchedParentheses))
--   Caught MismatchedParentheses
--   *Main> throw MismatchedParentheses catch e -> putStrLn ("Caught " ++ show (e :: SomeFrontendException))
--   Caught MismatchedParentheses
--   *Main> throw MismatchedParentheses catch e -> putStrLn ("Caught " ++ show (e :: SomeCompilerException))
--   Caught MismatchedParentheses
--   *Main> throw MismatchedParentheses catch e -> putStrLn ("Caught " ++ show (e :: IOException))
--   *** Exception: MismatchedParentheses
--   
class (Typeable * e, Show e) => Exception e
toException :: Exception e => e -> SomeException
fromException :: Exception e => SomeException -> Maybe e

-- | Render this exception value in a human-friendly manner.
--   
--   Default implementation: show.
displayException :: Exception e => e -> String

-- | The class Typeable allows a concrete representation of a type
--   to be calculated.
class Typeable k (a :: k)

-- | The SomeException type is the root of the exception type
--   hierarchy. When an exception of type e is thrown, behind the
--   scenes it is encapsulated in a SomeException.
data SomeException :: *
[SomeException] :: SomeException

-- | Superclass for asynchronous exceptions.
data SomeAsyncException :: *
[SomeAsyncException] :: SomeAsyncException

-- | Exceptions that occur in the IO monad. An
--   IOException records a more specific error type, a descriptive
--   string and maybe the handle that was used when the error was flagged.
data IOException :: *

-- | If the first argument evaluates to True, then the result is the
--   second argument. Otherwise an AssertionFailed exception is
--   raised, containing a String with the source file and line
--   number of the call to assert.
--   
--   Assertions can normally be turned on or off with a compiler flag (for
--   GHC, assertions are normally on unless optimisation is turned on with
--   -O or the -fignore-asserts option is given). When
--   assertions are turned off, the first argument to assert is
--   ignored, and the second argument is returned as the result.
assert :: Bool -> a -> a
instance GHC.Show.Show UnliftIO.Exception.SyncExceptionWrapper
instance GHC.Exception.Exception UnliftIO.Exception.SyncExceptionWrapper
instance GHC.Show.Show UnliftIO.Exception.AsyncExceptionWrapper
instance GHC.Exception.Exception UnliftIO.Exception.AsyncExceptionWrapper
instance GHC.Show.Show UnliftIO.Exception.StringException
instance GHC.Exception.Exception UnliftIO.Exception.StringException

-- | Temporary file and directory support.
--   
--   Strongly inspired by/stolen from the
--   https://github.com/feuerbach/temporary package.
module UnliftIO.Temporary

-- | Create and use a temporary file in the system standard temporary
--   directory.
--   
--   Behaves exactly the same as withTempFile, except that the
--   parent temporary directory will be that returned by
--   getCanonicalTemporaryDirectory.
withSystemTempFile :: MonadUnliftIO m => String -> (FilePath -> Handle -> m a) -> m a

-- | Create and use a temporary directory in the system standard temporary
--   directory.
--   
--   Behaves exactly the same as withTempDirectory, except that the
--   parent temporary directory will be that returned by
--   getCanonicalTemporaryDirectory.
withSystemTempDirectory :: MonadUnliftIO m => String -> (FilePath -> m a) -> m a

-- | Use a temporary filename that doesn't already exist.
--   
--   Creates a new temporary file inside the given directory, making use of
--   the template. The temp file is deleted after use. For example:
--   
--   
--   withTempFile "src" "sdist." $ \tmpFile hFile -> do ...
--   
--   
--   The tmpFile will be file in the given directory, e.g.
--   src/sdist.342.
withTempFile :: MonadUnliftIO m => FilePath -> String -> (FilePath -> Handle -> m a) -> m a

-- | Create and use a temporary directory.
--   
--   Creates a new temporary directory inside the given directory, making
--   use of the template. The temp directory is deleted after use. For
--   example:
--   
--   
--   withTempDirectory "src" "sdist." $ \tmpDir -> do ...
--   
--   
--   The tmpDir will be a new subdirectory of the given directory,
--   e.g. src/sdist.342.
withTempDirectory :: MonadUnliftIO m => FilePath -> String -> (FilePath -> m a) -> m a

-- | Lifted Control.Concurrent.Chan.
module UnliftIO.Chan

-- | Chan is an abstract type representing an unbounded FIFO
--   channel.
data Chan a :: * -> *

-- | Lifted newChan.
newChan :: MonadIO m => m (Chan a)

-- | Lifted writeChan.
writeChan :: MonadIO m => Chan a -> a -> m ()

-- | Lifted readChan.
readChan :: MonadIO m => Chan a -> m a

-- | Lifted dupChan.
dupChan :: MonadIO m => Chan a -> m (Chan a)

-- | Lifted getChanContents.
getChanContents :: MonadIO m => Chan a -> m [a]

-- | Lifted writeList2Chan.
writeList2Chan :: MonadIO m => Chan a -> [a] -> m ()

-- | Unlifted Control.Concurrent.
--   
--   This module is not reexported by UnliftIO, use it only if
--   UnliftIO.Async is not enough.
module UnliftIO.Concurrent

-- | A ThreadId is an abstract type representing a handle to a
--   thread. ThreadId is an instance of Eq, Ord and
--   Show, where the Ord instance implements an arbitrary
--   total ordering over ThreadIds. The Show instance lets
--   you convert an arbitrary-valued ThreadId to string form;
--   showing a ThreadId value is occasionally useful when debugging
--   or diagnosing the behaviour of a concurrent program.
--   
--   Note: in GHC, if you have a ThreadId, you essentially
--   have a pointer to the thread itself. This means the thread itself
--   can't be garbage collected until you drop the ThreadId. This
--   misfeature will hopefully be corrected at a later date.
data ThreadId :: *

-- | Lifted version of myThreadId.
myThreadId :: MonadIO m => m ThreadId

-- | Unlifted version of forkIO.
forkIO :: MonadUnliftIO m => m () -> m ThreadId

-- | Unlifted version of forkIOWithUnmask.
forkWithUnmask :: MonadUnliftIO m => ((forall a. m a -> m a) -> m ()) -> m ThreadId

-- | Unlifted version of forkFinally.
forkFinally :: MonadUnliftIO m => m a -> (Either SomeException a -> m ()) -> m ThreadId

-- | Lifted version of killThread.
killThread :: MonadIO m => ThreadId -> m ()

-- | Throw an asynchronous exception to another thread.
--   
--   Synchronously typed exceptions will be wrapped into an
--   AsyncExceptionWrapper, see
--   https://github.com/fpco/safe-exceptions#determining-sync-vs-async.
--   
--   It's usually a better idea to use the UnliftIO.Async module,
--   see https://github.com/fpco/safe-exceptions#quickstart.
throwTo :: (Exception e, MonadIO m) => ThreadId -> e -> m ()

-- | Unlifted version of forkOn.
forkOn :: MonadUnliftIO m => Int -> m () -> m ThreadId

-- | Unlifted version of forkOnWithUnmask.
forkOnWithUnmask :: MonadUnliftIO m => Int -> ((forall a. m a -> m a) -> m ()) -> m ThreadId

-- | Lifted version of getNumCapabilities.
getNumCapabilities :: MonadIO m => m Int

-- | Lifted version of setNumCapabilities.
setNumCapabilities :: MonadIO m => Int -> m ()

-- | Lifted version of threadCapability.
threadCapability :: MonadIO m => ThreadId -> m (Int, Bool)

-- | Lifted version of yield.
yield :: MonadIO m => m ()

-- | Lifted version of threadDelay.
threadDelay :: MonadIO m => Int -> m ()

-- | Lifted version of threadWaitRead.
threadWaitRead :: MonadIO m => Fd -> m ()

-- | Lifted version of threadWaitWrite.
threadWaitWrite :: MonadIO m => Fd -> m ()

-- | True if bound threads are supported. If
--   rtsSupportsBoundThreads is False,
--   isCurrentThreadBound will always return False and both
--   forkOS and runInBoundThread will fail.
rtsSupportsBoundThreads :: Bool

-- | Unflifted version of forkOS.
forkOS :: MonadUnliftIO m => m () -> m ThreadId

-- | Lifted version of isCurrentThreadBound.
isCurrentThreadBound :: MonadIO m => m Bool

-- | Unlifted version of runInBoundThread.
runInBoundThread :: MonadUnliftIO m => m a -> m a

-- | Unlifted version of runInUnboundThread.
runInUnboundThread :: MonadUnliftIO m => m a -> m a

-- | Lifted version of mkWeakThreadId.
mkWeakThreadId :: MonadIO m => ThreadId -> m (Weak ThreadId)

-- | Unlifted Control.Concurrent.Async.
module UnliftIO.Async

-- | An asynchronous action spawned by async or withAsync.
--   Asynchronous actions are executed in a separate thread, and operations
--   are provided for waiting for asynchronous actions to complete and
--   obtaining their results (see e.g. wait).
data Async a :: * -> *

-- | Unlifted async.
async :: MonadUnliftIO m => m a -> m (Async a)

-- | Unlifted asyncBound.
asyncBound :: MonadUnliftIO m => m a -> m (Async a)

-- | Unlifted asyncOn.
asyncOn :: MonadUnliftIO m => Int -> m a -> m (Async a)

-- | Unlifted asyncWithUnmask.
asyncWithUnmask :: MonadUnliftIO m => ((forall b. m b -> m b) -> m a) -> m (Async a)

-- | Unlifted asyncOnWithUnmask.
asyncOnWithUnmask :: MonadUnliftIO m => Int -> ((forall b. m b -> m b) -> m a) -> m (Async a)

-- | Unlifted withAsync.
withAsync :: MonadUnliftIO m => m a -> (Async a -> m b) -> m b

-- | Unlifted withAsyncBound.
withAsyncBound :: MonadUnliftIO m => m a -> (Async a -> m b) -> m b

-- | Unlifted withAsyncOn.
withAsyncOn :: MonadUnliftIO m => Int -> m a -> (Async a -> m b) -> m b

-- | Unlifted withAsyncWithUnmask.
withAsyncWithUnmask :: MonadUnliftIO m => ((forall c. m c -> m c) -> m a) -> (Async a -> m b) -> m b

-- | Unlifted withAsyncOnWithMask.
withAsyncOnWithUnmask :: MonadUnliftIO m => Int -> ((forall c. m c -> m c) -> m a) -> (Async a -> m b) -> m b

-- | Lifted wait.
wait :: MonadIO m => Async a -> m a

-- | Lifted poll.
poll :: MonadIO m => Async a -> m (Maybe (Either SomeException a))

-- | Lifted waitCatch.
waitCatch :: MonadIO m => Async a -> m (Either SomeException a)

-- | Lifted cancel.
cancel :: MonadIO m => Async a -> m ()

-- | Lifted uninterruptibleCancel.
uninterruptibleCancel :: MonadIO m => Async a -> m ()

-- | Lifted cancelWith. Additionally uses toAsyncException to
--   ensure async exception safety.
cancelWith :: (Exception e, MonadIO m) => Async a -> e -> m ()

-- | Returns the ThreadId of the thread running the given
--   Async.
asyncThreadId :: Async a -> ThreadId

-- | A version of wait that can be used inside an STM transaction.
waitSTM :: Async a -> STM a

-- | A version of poll that can be used inside an STM transaction.
pollSTM :: Async a -> STM (Maybe (Either SomeException a))

-- | A version of waitCatch that can be used inside an STM
--   transaction.
waitCatchSTM :: Async a -> STM (Either SomeException a)

-- | Lifted waitAny.
waitAny :: MonadIO m => [Async a] -> m (Async a, a)

-- | Lifted waitAnyCatch.
waitAnyCatch :: MonadIO m => [Async a] -> m (Async a, Either SomeException a)

-- | Lifted waitAnyCancel.
waitAnyCancel :: MonadIO m => [Async a] -> m (Async a, a)

-- | Lifted waitAnyCatchCancel.
waitAnyCatchCancel :: MonadIO m => [Async a] -> m (Async a, Either SomeException a)

-- | Lifted waitEither.
waitEither :: MonadIO m => Async a -> Async b -> m (Either a b)

-- | Lifted waitEitherCatch.
waitEitherCatch :: MonadIO m => Async a -> Async b -> m (Either (Either SomeException a) (Either SomeException b))

-- | Lifted waitEitherCancel.
waitEitherCancel :: MonadIO m => Async a -> Async b -> m (Either a b)

-- | Lifted waitEitherCatchCancel.
waitEitherCatchCancel :: MonadIO m => Async a -> Async b -> m (Either (Either SomeException a) (Either SomeException b))

-- | Lifted waitEither_.
waitEither_ :: MonadIO m => Async a -> Async b -> m ()

-- | Lifted waitBoth.
waitBoth :: MonadIO m => Async a -> Async b -> m (a, b)

-- | A version of waitAny that can be used inside an STM
--   transaction.
waitAnySTM :: [Async a] -> STM (Async a, a)

-- | A version of waitAnyCatch that can be used inside an STM
--   transaction.
waitAnyCatchSTM :: [Async a] -> STM (Async a, Either SomeException a)

-- | A version of waitEither that can be used inside an STM
--   transaction.
waitEitherSTM :: Async a -> Async b -> STM (Either a b)

-- | A version of waitEitherCatch that can be used inside an STM
--   transaction.
waitEitherCatchSTM :: Async a -> Async b -> STM (Either (Either SomeException a) (Either SomeException b))

-- | A version of waitEither_ that can be used inside an STM
--   transaction.
waitEitherSTM_ :: Async a -> Async b -> STM ()

-- | A version of waitBoth that can be used inside an STM
--   transaction.
waitBothSTM :: Async a -> Async b -> STM (a, b)

-- | Lifted link.
link :: MonadIO m => Async a -> m ()

-- | Lifted link2.
link2 :: MonadIO m => Async a -> Async b -> m ()

-- | Unlifted race.
race :: MonadUnliftIO m => m a -> m b -> m (Either a b)

-- | Unlifted race_.
race_ :: MonadUnliftIO m => m a -> m b -> m ()

-- | Unlifted concurrently.
concurrently :: MonadUnliftIO m => m a -> m b -> m (a, b)

-- | Unlifted concurrently_.
concurrently_ :: MonadUnliftIO m => m a -> m b -> m ()

-- | Unlifted mapConcurrently.
mapConcurrently :: MonadUnliftIO m => Traversable t => (a -> m b) -> t a -> m (t b)

-- | Unlifted forConcurrently.
forConcurrently :: MonadUnliftIO m => Traversable t => t a -> (a -> m b) -> m (t b)

-- | Unlifted mapConcurrently_.
mapConcurrently_ :: MonadUnliftIO m => Foldable f => (a -> m b) -> f a -> m ()

-- | Unlifted forConcurrently_.
forConcurrently_ :: MonadUnliftIO m => Foldable f => f a -> (a -> m b) -> m ()

-- | Unlifted replicateConcurrently.
replicateConcurrently :: MonadUnliftIO m => Int -> m a -> m [a]

-- | Unlifted replicateConcurrently_.
replicateConcurrently_ :: MonadUnliftIO m => Int -> m a -> m ()

-- | Unlifted Concurrently.
newtype Concurrently m a
Concurrently :: m a -> Concurrently m a
[runConcurrently] :: Concurrently m a -> m a
instance GHC.Base.Monad m => GHC.Base.Functor (UnliftIO.Async.Concurrently m)
instance Control.Monad.IO.Unlift.MonadUnliftIO m => GHC.Base.Applicative (UnliftIO.Async.Concurrently m)
instance Control.Monad.IO.Unlift.MonadUnliftIO m => GHC.Base.Alternative (UnliftIO.Async.Concurrently m)
instance (Control.Monad.IO.Unlift.MonadUnliftIO m, Data.Semigroup.Semigroup a) => Data.Semigroup.Semigroup (UnliftIO.Async.Concurrently m a)
instance (Data.Semigroup.Semigroup a, GHC.Base.Monoid a, Control.Monad.IO.Unlift.MonadUnliftIO m) => GHC.Base.Monoid (UnliftIO.Async.Concurrently m a)

module UnliftIO
