-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | A fast ECS for game engine programming
--
-- A fast ECS for game engine programming
@package apecs
@version 0.2.2.0
module Apecs.Types
-- | An Entity is really just an Int. The type variable is used to keep
-- track of reads and writes, but can be freely cast.
newtype Entity c
Entity :: Int -> Entity c
-- | A slice is a list of entities, represented by a Data.Unbox.Vector of
-- Ints.
newtype Slice c
Slice :: Vector Int -> Slice c
[unSlice] :: Slice c -> Vector Int
-- | A system is a newtype around `ReaderT w IO a`, where w is the
-- game world variable.
newtype System w a
System :: ReaderT w IO a -> System w a
[unSystem] :: System w a -> ReaderT w IO a
-- | A component is defined by the type of its storage The storage in turn
-- supplies runtime types for the component. For the component to be
-- valid, its Storage must be in instance of Store.
class (Stores (Storage c) ~ c, Store (Storage c)) => Component c where type Storage c = s | s -> c where {
type family Storage c = s | s -> c;
}
-- | A world Has a component if it can produce its Storage
class Component c => Has w c
getStore :: Has w c => System w (Storage c)
-- | Represents a safe access to c. A safe access is either a read
-- that might fail, or a write that might delete.
newtype Safe c
Safe :: SafeRW (Storage c) -> Safe c
[getSafe] :: Safe c -> SafeRW (Storage c)
-- | Holds components indexed by entities
class Store s where type Stores s type SafeRW s type InitArgs s explReset s = do { sl <- explMembers s; mapM_ (explDestroy s) sl } explImapM_ s ma = liftIO (explMembers s) >>= mapM_ ma . toList explImapM s ma = liftIO (explMembers s) >>= mapM ma . toList explModify s ety f = do { etyExists <- explExists s ety; when etyExists $ explGetUnsafe s ety >>= explSet s ety . f } explCmap s f = explMembers s >>= mapM_ (\ ety -> explModify s ety f) explCmapM_ s sys = do { sl <- liftIO $ explMembers s; forM_ sl $ \ ety -> do { x :: Stores s <- liftIO $ explGetUnsafe s ety; sys x } } explCimapM_ s sys = do { sl <- liftIO $ explMembers s; forM_ sl $ \ ety -> do { x :: Stores s <- liftIO $ explGetUnsafe s ety; sys (ety, x) } } explCmapM s sys = do { sl <- liftIO $ explMembers s; for (toList sl) $ \ ety -> do { x :: Stores s <- liftIO $ explGetUnsafe s ety; sys x } } explCimapM s sys = do { sl <- liftIO $ explMembers s; for (toList sl) $ \ ety -> do { x :: Stores s <- liftIO $ explGetUnsafe s ety; sys (ety, x) } } where {
type family Stores s;
type family SafeRW s;
type family InitArgs s;
}
-- | Retrieves a component from the store
explGet :: Store s => s -> Int -> IO (SafeRW s)
-- | Writes a component
explSet :: Store s => s -> Int -> Stores s -> IO ()
-- | Destroys the component for the given index.
explDestroy :: Store s => s -> Int -> IO ()
-- | Returns whether there is a component for the given index
explExists :: Store s => s -> Int -> IO Bool
-- | Returns an unboxed vector of member indices
explMembers :: Store s => s -> IO (Vector Int)
-- | Unsafe index to the store. Undefined if the component does not exist
explGetUnsafe :: Store s => s -> Int -> IO (Stores s)
-- | Either writes or deletes a component
explSetMaybe :: Store s => s -> Int -> SafeRW s -> IO ()
initStoreWith :: Store s => InitArgs s -> IO s
-- | Removes all components. Equivalent to calling explDestroy on
-- each member
explReset :: Store s => s -> IO ()
-- | Monadically iterates over member indices
explImapM_ :: (Store s, MonadIO m) => s -> (Int -> m a) -> m ()
-- | Monadically iterates over member indices
explImapM :: (Store s, MonadIO m) => s -> (Int -> m a) -> m [a]
-- | Modifies an element in the store. Equivalent to reading a value, and
-- then writing the result of the function application.
explModify :: Store s => s -> Int -> (Stores s -> Stores s) -> IO ()
-- | Maps over all elements of this store. Equivalent to getting a list of
-- all entities with this component, and then explModifying each of them.
explCmap :: Store s => s -> (Stores s -> Stores s) -> IO ()
explCmapM_ :: (Store s, MonadIO m) => s -> (Stores s -> m a) -> m ()
explCimapM_ :: (Store s, MonadIO m) => s -> ((Int, Stores s) -> m a) -> m ()
explCmapM :: (Store s, MonadIO m) => s -> (Stores s -> m a) -> m [a]
explCimapM :: (Store s, MonadIO m) => s -> ((Int, Stores s) -> m a) -> m [a]
-- | Class of storages for global values
class (SafeRW s ~ Stores s, Store s) => GlobalStore s
-- | Casts for entities and slices
class Cast a b
cast :: Cast a b => a -> b
instance Control.Monad.IO.Class.MonadIO (Apecs.Types.System w)
instance GHC.Base.Applicative (Apecs.Types.System w)
instance GHC.Base.Monad (Apecs.Types.System w)
instance GHC.Base.Functor (Apecs.Types.System w)
instance GHC.Base.Monoid (Apecs.Types.Slice c)
instance GHC.Show.Show (Apecs.Types.Slice c)
instance GHC.Show.Show (Apecs.Types.Entity c)
instance GHC.Classes.Ord (Apecs.Types.Entity c)
instance GHC.Classes.Eq (Apecs.Types.Entity c)
instance Apecs.Types.Cast (Apecs.Types.Entity a) (Apecs.Types.Entity b)
instance Apecs.Types.Cast (Apecs.Types.Slice a) (Apecs.Types.Slice b)
instance (Apecs.Types.Component a, Apecs.Types.Component b) => Apecs.Types.Component (a, b)
instance (Apecs.Types.Has w a, Apecs.Types.Has w b) => Apecs.Types.Has w (a, b)
instance (Apecs.Types.Store a, Apecs.Types.Store b) => Apecs.Types.Store (a, b)
instance (Apecs.Types.GlobalStore a, Apecs.Types.GlobalStore b) => Apecs.Types.GlobalStore (a, b)
instance (Apecs.Types.Component a, Apecs.Types.Component b, Apecs.Types.Component c) => Apecs.Types.Component (a, b, c)
instance (Apecs.Types.Has w a, Apecs.Types.Has w b, Apecs.Types.Has w c) => Apecs.Types.Has w (a, b, c)
instance (Apecs.Types.Store a, Apecs.Types.Store b, Apecs.Types.Store c) => Apecs.Types.Store (a, b, c)
instance (Apecs.Types.GlobalStore a, Apecs.Types.GlobalStore b, Apecs.Types.GlobalStore c) => Apecs.Types.GlobalStore (a, b, c)
module Apecs.System
-- | Run a system with a game world
runSystem :: System w a -> w -> IO a
-- | Run a system with a game world
runWith :: w -> System w a -> IO a
-- | A slice containing all entities with component c
owners :: forall w c. Has w c => System w (Slice c)
-- | Returns whether the given entity has component c For
-- composite components, this indicates whether the component has all its
-- constituents
exists :: forall w c. Has w c => Entity c -> System w Bool
-- | Destroys the component c for the given entity
destroy :: forall w c. Has w c => Entity c -> System w ()
-- | Removes all components. Equivalent to manually iterating and deleting,
-- but usually optimized.
resetStore :: forall w c p. Has w c => p c -> System w ()
-- | Gets the component for a given entity. This is a safe access, because
-- the entity might not have the requested components.
get :: forall w c. Has w c => Entity c -> System w (Safe c)
-- | Writes a component to a given entity. Will overwrite existing
-- components.
set :: forall w c e. Has w c => Entity e -> c -> System w ()
-- | Same as set, but uses Safe to possibly delete a component
set' :: forall w c. Has w c => Entity c -> Safe c -> System w ()
-- | Applies a function if possible. Equivalent to reading, mapping, and
-- writing, but stores can provide optimized implementations.
modify :: forall w c. Has w c => Entity c -> (c -> c) -> System w ()
-- | Monadically iterate a system over all entities that have that
-- component. Note that writing to the store while iterating over it is
-- undefined behaviour.
imapM_ :: forall w c. Has w c => (Entity c -> System w ()) -> System w ()
-- | Monadically iterate a system over all entities that have that
-- component. Note that writing to the store while iterating over it is
-- undefined behaviour.
imapM :: forall w c a. Has w c => (Entity c -> System w a) -> System w [a]
-- | Maps a pure function over all components
cmap :: forall world c. Has world c => (c -> c) -> System world ()
-- | mapM_ version of cmap
cmapM_ :: forall w c. Has w c => (c -> System w ()) -> System w ()
-- | indexed cmapM_, also gives the current entity.
cimapM_ :: forall w c. Has w c => ((Entity c, c) -> System w ()) -> System w ()
-- | mapM version of cmap. Can be used to get a list of entities
cmapM :: forall w c a. Has w c => (c -> System w a) -> System w [a]
-- | indexed cmapM, also gives the current entity.
cimapM :: forall w c a. Has w c => ((Entity c, c) -> System w a) -> System w [a]
-- | Maps a function that might delete its components
cmap' :: forall world c. Has world c => (c -> Safe c) -> System world ()
-- | Maps a function over all entities with a r, and writes their
-- w
rmap :: forall world r w. (Has world w, Has world r) => (r -> w) -> System world ()
-- | Maps a function over all entities with a r, and writes or
-- deletes their w
rmap' :: forall world r w. (Has world w, Has world r, Store (Storage r), Store (Storage w)) => (r -> Safe w) -> System world ()
-- | For all entities with a w, this map reads their r
-- and writes their w
wmap :: forall world r w. (Has world w, Has world r, Store (Storage r), Store (Storage w)) => (Safe r -> w) -> System world ()
-- | For all entities with a w, this map reads their r
-- and writes or deletes their w
wmap' :: forall world r w. (Has world w, Has world r, Store (Storage r), Store (Storage w)) => (Safe r -> Safe w) -> System world ()
-- | Reads a global value
readGlobal :: forall w c. (Has w c, GlobalStore (Storage c)) => System w c
-- | Writes a global value
writeGlobal :: forall w c. (Has w c, GlobalStore (Storage c)) => c -> System w ()
-- | Modifies a global value
modifyGlobal :: forall w c. (Has w c, GlobalStore (Storage c)) => (c -> c) -> System w ()
module Apecs.Stores
-- | A map from Data.Intmap.Strict. O(n log(n)) for most operations. Yields
-- safe runtime representations of type Maybe c.
data Map c
-- | A store that keeps membership, but holds no values. Produces
-- flag runtime values.
data Set c
-- | Class for flags, used by Set to yield runtime
-- representations.
class Flag c
flag :: Flag c => c
-- | A cache around another store. The wrapped store must produce safe
-- representations using Maybe. Note that iterating over a cache is
-- linear in its size, so large, sparsely populated caches will actually
-- decrease performance.
data Cache (n :: Nat) s
-- | A Unique contains exactly one component belonging to some entity.
-- Writing to it overwrites both the previous component and its owner.
data Unique c
-- | Global value. Must be given an initial value upon construction.
data Global c
class (Store s, SafeRW s ~ Maybe (Stores s)) => Cachable s
instance Apecs.Types.Store (Apecs.Stores.Map c)
instance Apecs.Stores.Flag c => Apecs.Types.Store (Apecs.Stores.Set c)
instance Apecs.Types.Store (Apecs.Stores.Unique c)
instance Apecs.Types.Store (Apecs.Stores.Const c)
instance Apecs.Types.GlobalStore (Apecs.Stores.Const c)
instance Apecs.Types.GlobalStore (Apecs.Stores.Global c)
instance Apecs.Types.Store (Apecs.Stores.Global c)
instance Apecs.Stores.Cachable (Apecs.Stores.Map s)
instance (GHC.TypeLits.KnownNat n, Apecs.Stores.Cachable s) => Apecs.Stores.Cachable (Apecs.Stores.Cache n s)
instance (GHC.TypeLits.KnownNat n, Apecs.Stores.Cachable s) => Apecs.Types.Store (Apecs.Stores.Cache n s)
module Apecs.Util
-- | Initializes a store with (), useful since most stores have () as their
-- initialization argument
initStore :: (Store s, InitArgs s ~ ()) => IO s
-- | Explicitly invoke the garbage collector
runGC :: System w ()
unEntity :: Entity a -> Int
-- | Secretly just an int in a newtype
data EntityCounter
-- | Initialize an EntityCounter
initCounter :: IO (Storage EntityCounter)
-- | Bumps the EntityCounter and yields its value
nextEntity :: Has w EntityCounter => System w (Entity ())
-- | Writes the given components to a new entity, and yields that entity
newEntity :: (Store (Storage c), Has w c, Has w EntityCounter) => c -> System w (Entity c)
-- | Quantize turns a world-space coordinate into a table-space coordinate
-- by dividing by the given cell size and rounding towards negative
-- infinity.
quantize :: (Fractional (v a), Integral b, RealFrac a, Functor v) => v a -> v a -> v b
-- | Turns a table-space vector into an integral index, given some table
-- size vector. Yields Nothing for out-of-bounds queries
flatten :: (Applicative v, Integral a, Foldable v) => v a -> v a -> Maybe a
-- | Tests whether a vector is in the region given by 0 and the size vector
-- (inclusive)
inbounds :: (Num a, Ord a, Applicative v, Foldable v) => v a -> v a -> Bool
-- | For two table-space vectors indicating a region's bounds, gives a list
-- of the vectors contained between them. This is useful for querying a
-- spatial hash.
region :: (Enum a, Applicative v, Traversable v) => v a -> v a -> [v a]
-- | Unsafe version of flatten. Yields garbage for out-of-bounds queries.
unsafeFlatten :: (Applicative v, Integral a, Foldable v) => v a -> v a -> a
-- | Runs a system and gives its execution time in seconds
timeSystem :: System w a -> System w (Double, a)
-- | Runs a system, discards its output, and gives its execution time in
-- seconds
timeSystem_ :: System w a -> System w Double
instance GHC.Show.Show Apecs.Util.EntityCounter
instance GHC.Classes.Eq Apecs.Util.EntityCounter
instance GHC.Num.Num Apecs.Util.EntityCounter
instance Apecs.Types.Component Apecs.Util.EntityCounter
-- | This module is designed to be imported with qualified
module Apecs.Slice
-- | Slice version of foldM_
foldM_ :: (a -> Entity c -> System w a) -> a -> Slice b -> System w ()
-- | Gets the size of a slice (O(n))
size :: Slice a -> Int
-- | Tests whether a slice is empty (O(1))
null :: Slice a -> Bool
-- | Construct a slice from a list of IDs
fromList :: [Int] -> Slice a
-- | Monadically filter a slice
filterM :: (Entity c -> System w Bool) -> Slice c -> System w (Slice c)
-- | Concatenates two slices. Equivalent to mappend
concat :: Slice a -> Slice b -> Slice c
-- | Slice version of forM_
forM_ :: Monad m => Slice c -> (Entity c -> m b) -> m ()
-- | Slice version of forM
forM :: Monad m => Slice c -> (Entity c -> m a) -> m [a]
-- | Iterates over a slice, and reads the components of the Slice's type
-- argument.
forMC :: forall w c a. Has w c => Slice c -> ((Entity c, Safe c) -> System w a) -> System w [a]
-- | Iterates over a slice, and reads the components of the Slice's type
-- argument.
forMC_ :: forall w c a. Has w c => Slice c -> ((Entity c, Safe c) -> System w a) -> System w ()
-- | Slice version of mapM_
mapM_ :: Monad m => (Entity c -> m a) -> Slice c -> m ()
-- | Slice version of mapM
mapM :: Monad m => (Entity c -> m a) -> Slice c -> m [a]
-- | Iterates over a slice, and reads the components of the Slice's type
-- argument.
mapMC :: forall w c a. Has w c => ((Entity c, Safe c) -> System w a) -> Slice c -> System w [a]
-- | Iterates over a slice, and reads the components of the Slice's type
-- argument.
mapMC_ :: forall w c a. Has w c => ((Entity c, Safe c) -> System w a) -> Slice c -> System w ()
module Apecs.Logs
-- | A Log is a PureLog with mutable state.
class Log l c
logEmpty :: Log l c => IO (l c)
logOnSet :: Log l c => l c -> Entity a -> Maybe c -> c -> IO ()
logOnDestroy :: Log l c => l c -> Entity a -> c -> IO ()
logReset :: Log l c => l c -> IO ()
-- | A PureLog is a piece of state l c that is updated when
-- components c are written or destroyed. Note that l :: *
-- -> *
class PureLog l c
pureEmpty :: PureLog l c => l c
pureOnSet :: PureLog l c => Entity a -> Maybe c -> c -> l c -> l c
pureOnDestroy :: PureLog l c => Entity a -> c -> l c -> l c
-- | FromPure turns a PureLog into a Log
newtype FromPure l c
FromPure :: (IORef (l c)) -> FromPure l c
-- | A Logger l of some store updates its Log l with the
-- writes and deletes to store s
data Logger l s
-- | Produces the log indicated by the return type.
getLog :: forall w c l. (Store (Storage c), Has w c, HasLog (Storage c) l, Log l c) => System w (l c)
-- | Read the value of an IORef
readIORef :: IORef a -> IO a
-- | Composite Log consisting of 1 Log
data LVec1 l c
-- | Composite Log consisting of 2 Logs
data LVec2 l1 l2 c
-- | Composite Log consisting of 3 Logs
data LVec3 l1 l2 l3 c
-- | Hashtable that maintains buckets of entities whose fromEnum c
-- produces the same value
data EnumTable c
-- | Query the EnumTable by an index (the result of
-- fromEnum). Will return an empty slice if index <
-- 0 of index >= fromEnum (maxBound).
byIndex :: EnumTable c -> Int -> System w (Slice c)
-- | Query the EnumTable by an example enum. Will not perform
-- bound checks, so crashes if `fromEnum c && fromEnum c
-- fromEnum maxBound `.
byEnum :: Enum c => EnumTable c -> c -> System w (Slice c)
instance Apecs.Logs.HasLog (Apecs.Logs.Logger l s) l
instance Apecs.Logs.PureLog l c => Apecs.Logs.Log (Apecs.Logs.FromPure l) c
instance (Apecs.Logs.Log l (Apecs.Types.Stores s), Apecs.Stores.Cachable s) => Apecs.Types.Store (Apecs.Logs.Logger l s)
instance Apecs.Logs.Log l c => Apecs.Logs.Log (Apecs.Logs.LVec1 l) c
instance (Apecs.Logs.Log l1 c, Apecs.Logs.Log l2 c) => Apecs.Logs.Log (Apecs.Logs.LVec2 l1 l2) c
instance (Apecs.Logs.Log l1 c, Apecs.Logs.Log l2 c, Apecs.Logs.Log l3 c) => Apecs.Logs.Log (Apecs.Logs.LVec3 l1 l2 l3) c
instance (GHC.Enum.Bounded c, GHC.Enum.Enum c) => Apecs.Logs.Log Apecs.Logs.EnumTable c
-- | This module forms the apecs Prelude. It selectively re-exports the
-- user-facing functions from the submodules.
module Apecs
-- | A system is a newtype around `ReaderT w IO a`, where w is the
-- game world variable.
newtype System w a
System :: ReaderT w IO a -> System w a
[unSystem] :: System w a -> ReaderT w IO a
-- | A component is defined by the type of its storage The storage in turn
-- supplies runtime types for the component. For the component to be
-- valid, its Storage must be in instance of Store.
class (Stores (Storage c) ~ c, Store (Storage c)) => Component c where type Storage c = s | s -> c where {
type family Storage c = s | s -> c;
}
-- | An Entity is really just an Int. The type variable is used to keep
-- track of reads and writes, but can be freely cast.
newtype Entity c
Entity :: Int -> Entity c
-- | A slice is a list of entities, represented by a Data.Unbox.Vector of
-- Ints.
data Slice c
-- | A world Has a component if it can produce its Storage
class Component c => Has w c
getStore :: Has w c => System w (Storage c)
-- | Represents a safe access to c. A safe access is either a read
-- that might fail, or a write that might delete.
newtype Safe c
Safe :: SafeRW (Storage c) -> Safe c
[getSafe] :: Safe c -> SafeRW (Storage c)
cast :: Cast a b => a -> b
-- | A map from Data.Intmap.Strict. O(n log(n)) for most operations. Yields
-- safe runtime representations of type Maybe c.
data Map c
-- | A store that keeps membership, but holds no values. Produces
-- flag runtime values.
data Set c
-- | A Unique contains exactly one component belonging to some entity.
-- Writing to it overwrites both the previous component and its owner.
data Unique c
-- | Global value. Must be given an initial value upon construction.
data Global c
-- | Class for flags, used by Set to yield runtime
-- representations.
class Flag c
flag :: Flag c => c
initStoreWith :: Store s => InitArgs s -> IO s
-- | Destroys the component c for the given entity
destroy :: forall w c. Has w c => Entity c -> System w ()
-- | Returns whether the given entity has component c For
-- composite components, this indicates whether the component has all its
-- constituents
exists :: forall w c. Has w c => Entity c -> System w Bool
-- | A slice containing all entities with component c
owners :: forall w c. Has w c => System w (Slice c)
-- | Removes all components. Equivalent to manually iterating and deleting,
-- but usually optimized.
resetStore :: forall w c p. Has w c => p c -> System w ()
-- | Gets the component for a given entity. This is a safe access, because
-- the entity might not have the requested components.
get :: forall w c. Has w c => Entity c -> System w (Safe c)
-- | Writes a component to a given entity. Will overwrite existing
-- components.
set :: forall w c e. Has w c => Entity e -> c -> System w ()
-- | Same as set, but uses Safe to possibly delete a component
set' :: forall w c. Has w c => Entity c -> Safe c -> System w ()
-- | Applies a function if possible. Equivalent to reading, mapping, and
-- writing, but stores can provide optimized implementations.
modify :: forall w c. Has w c => Entity c -> (c -> c) -> System w ()
-- | Maps a pure function over all components
cmap :: forall world c. Has world c => (c -> c) -> System world ()
-- | mapM version of cmap. Can be used to get a list of entities
cmapM :: forall w c a. Has w c => (c -> System w a) -> System w [a]
-- | mapM_ version of cmap
cmapM_ :: forall w c. Has w c => (c -> System w ()) -> System w ()
-- | indexed cmapM, also gives the current entity.
cimapM :: forall w c a. Has w c => ((Entity c, c) -> System w a) -> System w [a]
-- | indexed cmapM_, also gives the current entity.
cimapM_ :: forall w c. Has w c => ((Entity c, c) -> System w ()) -> System w ()
-- | Maps a function over all entities with a r, and writes or
-- deletes their w
rmap' :: forall world r w. (Has world w, Has world r, Store (Storage r), Store (Storage w)) => (r -> Safe w) -> System world ()
-- | Maps a function over all entities with a r, and writes their
-- w
rmap :: forall world r w. (Has world w, Has world r) => (r -> w) -> System world ()
-- | For all entities with a w, this map reads their r
-- and writes their w
wmap :: forall world r w. (Has world w, Has world r, Store (Storage r), Store (Storage w)) => (Safe r -> w) -> System world ()
-- | For all entities with a w, this map reads their r
-- and writes or deletes their w
wmap' :: forall world r w. (Has world w, Has world r, Store (Storage r), Store (Storage w)) => (Safe r -> Safe w) -> System world ()
-- | Maps a function that might delete its components
cmap' :: forall world c. Has world c => (c -> Safe c) -> System world ()
-- | Reads a global value
readGlobal :: forall w c. (Has w c, GlobalStore (Storage c)) => System w c
-- | Writes a global value
writeGlobal :: forall w c. (Has w c, GlobalStore (Storage c)) => c -> System w ()
-- | Modifies a global value
modifyGlobal :: forall w c. (Has w c, GlobalStore (Storage c)) => (c -> c) -> System w ()
-- | Run a system with a game world
runSystem :: System w a -> w -> IO a
-- | Run a system with a game world
runWith :: w -> System w a -> IO a
-- | Initializes a store with (), useful since most stores have () as their
-- initialization argument
initStore :: (Store s, InitArgs s ~ ()) => IO s
-- | Explicitly invoke the garbage collector
runGC :: System w ()
-- | Secretly just an int in a newtype
data EntityCounter
-- | Initialize an EntityCounter
initCounter :: IO (Storage EntityCounter)
-- | Writes the given components to a new entity, and yields that entity
newEntity :: (Store (Storage c), Has w c, Has w EntityCounter) => c -> System w (Entity c)
-- | Retrieves a function of the current environment.
asks :: MonadReader r m => (r -> a) -> m a
-- | Retrieves the monad environment.
ask :: MonadReader r m => m r
-- | Lift a computation from the IO monad.
liftIO :: MonadIO m => forall a. IO a -> m a
-- | Lift a computation from the argument monad to the constructed monad.
lift :: MonadTrans t => forall (m :: * -> *) a. Monad m => m a -> t m a