mirror of
https://github.com/haskell-effectful/effectful.git
synced 2024-11-24 07:14:04 +03:00
Haddock improvements
This commit is contained in:
parent
ae0a67f46f
commit
485e3e08f4
@ -18,9 +18,13 @@ module Effectful
|
|||||||
, runPureEff
|
, runPureEff
|
||||||
|
|
||||||
-- ** Computations with side effects
|
-- ** Computations with side effects
|
||||||
, IOE
|
|
||||||
, runEff
|
, runEff
|
||||||
|
|
||||||
|
-- *** Integration with the 'IO' monad
|
||||||
|
, IOE
|
||||||
|
, MonadIO(..)
|
||||||
|
, MonadUnliftIO(..)
|
||||||
|
|
||||||
-- ** Unlift strategies
|
-- ** Unlift strategies
|
||||||
, UnliftStrategy(..)
|
, UnliftStrategy(..)
|
||||||
, Persistence(..)
|
, Persistence(..)
|
||||||
@ -28,10 +32,6 @@ module Effectful
|
|||||||
, unliftStrategy
|
, unliftStrategy
|
||||||
, withUnliftStrategy
|
, withUnliftStrategy
|
||||||
, withEffToIO
|
, withEffToIO
|
||||||
|
|
||||||
-- * Re-exports
|
|
||||||
, MonadIO(..)
|
|
||||||
, MonadUnliftIO(..)
|
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Control.Monad.IO.Class
|
import Control.Monad.IO.Class
|
||||||
|
@ -214,7 +214,7 @@ import Effectful.Internal.Monad
|
|||||||
-- t1 <- liftIO getMonotonicTime
|
-- t1 <- liftIO getMonotonicTime
|
||||||
-- r <- action
|
-- r <- action
|
||||||
-- t2 <- liftIO getMonotonicTime
|
-- t2 <- liftIO getMonotonicTime
|
||||||
-- liftIO . putStrLn $ label ++ "' took " ++ show (t2 - t1) ++ " seconds"
|
-- liftIO . putStrLn $ "Action '" ++ label ++ "' took " ++ show (t2 - t1) ++ " seconds."
|
||||||
-- pure r
|
-- pure r
|
||||||
-- :}
|
-- :}
|
||||||
-- ...
|
-- ...
|
||||||
|
@ -161,9 +161,9 @@ withUnliftStrategy unlift = localStaticRep $ \_ -> IOE unlift
|
|||||||
|
|
||||||
-- | Create an unlifting function with the current 'UnliftStrategy'.
|
-- | Create an unlifting function with the current 'UnliftStrategy'.
|
||||||
--
|
--
|
||||||
-- This function is equivalent to 'withRunInIO', but has a 'HasCallStack'
|
-- This function is equivalent to 'Effectful.withRunInIO', but has a
|
||||||
-- constraint for accurate stack traces in case an insufficiently powerful
|
-- 'HasCallStack' constraint for accurate stack traces in case an insufficiently
|
||||||
-- 'UnliftStrategy' is used and the unlifting function fails.
|
-- powerful 'UnliftStrategy' is used and the unlifting function fails.
|
||||||
--
|
--
|
||||||
-- /Note:/ the strategy is reset to 'SeqUnlift' inside the continuation.
|
-- /Note:/ the strategy is reset to 'SeqUnlift' inside the continuation.
|
||||||
withEffToIO
|
withEffToIO
|
||||||
@ -295,7 +295,7 @@ instance IOE :> es => MonadBase IO (Eff es) where
|
|||||||
liftBase = unsafeEff_
|
liftBase = unsafeEff_
|
||||||
|
|
||||||
-- | Instance included for compatibility with existing code, usage of
|
-- | Instance included for compatibility with existing code, usage of
|
||||||
-- 'withRunInIO' is preferrable.
|
-- 'Effectful.withRunInIO' is preferrable.
|
||||||
instance IOE :> es => MonadBaseControl IO (Eff es) where
|
instance IOE :> es => MonadBaseControl IO (Eff es) where
|
||||||
type StM (Eff es) a = a
|
type StM (Eff es) a = a
|
||||||
liftBaseWith = withEffToIO
|
liftBaseWith = withEffToIO
|
||||||
|
@ -36,7 +36,7 @@ import Effectful.Internal.Utils
|
|||||||
-- Unlift strategies
|
-- Unlift strategies
|
||||||
|
|
||||||
-- | The strategy to use when unlifting 'Effectful.Eff' computations via
|
-- | The strategy to use when unlifting 'Effectful.Eff' computations via
|
||||||
-- 'withRunInIO', 'Effectful.withEffToIO' or the
|
-- 'Effectful.withRunInIO', 'Effectful.withEffToIO' or the
|
||||||
-- 'Effectful.Dispatch.Dynamic.localUnlift' family.
|
-- 'Effectful.Dispatch.Dynamic.localUnlift' family.
|
||||||
data UnliftStrategy
|
data UnliftStrategy
|
||||||
= SeqUnlift
|
= SeqUnlift
|
||||||
|
Loading…
Reference in New Issue
Block a user