Hoogle Search
Within LTS Haskell 24.66 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
callForward :: Serializable a => (a -> (ProcessId, c)) -> Match cdistributed-process-extras Control.Distributed.Process.Extras.Call Produces a Match that can be used with the receiveWait family of message-receiving functions. When calllForward receives a message of type from from callTimeout (and similar), it will forward the message to another process, who will be responsible for responding to it. It is the user's responsibility to ensure that the forwarding process is linked to the destination process, so that if it fails, the sender will be notified.
type
LogFormat = String -> Process Stringdistributed-process-extras Control.Distributed.Process.Extras.SystemLog No documentation available.
addFormatter :: Addressable r => r -> Closure (Message -> Process (Maybe String)) -> Process ()distributed-process-extras Control.Distributed.Process.Extras.SystemLog No documentation available.
sleepFor :: Int -> TimeUnit -> Process ()distributed-process-extras Control.Distributed.Process.Extras.Timer Literate way of saying sleepFor 3 Seconds.
tryForkProcess :: LocalNode -> Process () -> IO ProcessIddistributed-process-systest Control.Distributed.Process.SysTest.Utils No documentation available.
BeforeNonBlank :: Doc a -> Doc adoctemplates Text.DocTemplates Doc that renders only before nonblank.
SeqForkUnlift :: UnliftStrategyeffectful-core Effectful Like SeqUnlift, but all unlifted actions will be executed in a cloned environment. The main consequence is that thread local state is forked at the point of creation of the unlifting function and its modifications in unlifted actions will not affect the main thread of execution (and vice versa):
>>> import Effectful >>> import Effectful.State.Dynamic >>> :{ action :: (IOE :> es, State Int :> es) => Eff es () action = do modify @Int (+1) withEffToIO SeqForkUnlift $ \unlift -> unlift $ modify @Int (+2) modify @Int (+4) :}>>> runEff . execStateLocal @Int 0 $ action 5
>>> runEff . execStateShared @Int 0 $ action 7
Because of this it's possible to safely use the unlifting function outside of the scope of effects it captures, e.g. by creating an IO action that executes effectful operations and running it later:>>> :{ delayed :: UnliftStrategy -> IO (IO String) delayed strategy = runEff . evalStateLocal "Hey" $ do r <- withEffToIO strategy $ \unlift -> pure $ unlift get modify (++ "!!!") pure r :}This doesn't work with the SeqUnlift strategy because when the returned action runs, State is no longer in scope:>>> join $ delayed SeqUnlift *** Exception: version (...) /= storageVersion (0) ...
However, it does with the SeqForkUnlift strategy:>>> join $ delayed SeqForkUnlift "Hey"
SeqForkUnlift :: UnliftStrategyeffectful-core Effectful.Internal.Monad Like SeqUnlift, but all unlifted actions will be executed in a cloned environment. The main consequence is that thread local state is forked at the point of creation of the unlifting function and its modifications in unlifted actions will not affect the main thread of execution (and vice versa):
>>> import Effectful >>> import Effectful.State.Dynamic >>> :{ action :: (IOE :> es, State Int :> es) => Eff es () action = do modify @Int (+1) withEffToIO SeqForkUnlift $ \unlift -> unlift $ modify @Int (+2) modify @Int (+4) :}>>> runEff . execStateLocal @Int 0 $ action 5
>>> runEff . execStateShared @Int 0 $ action 7
Because of this it's possible to safely use the unlifting function outside of the scope of effects it captures, e.g. by creating an IO action that executes effectful operations and running it later:>>> :{ delayed :: UnliftStrategy -> IO (IO String) delayed strategy = runEff . evalStateLocal "Hey" $ do r <- withEffToIO strategy $ \unlift -> pure $ unlift get modify (++ "!!!") pure r :}This doesn't work with the SeqUnlift strategy because when the returned action runs, State is no longer in scope:>>> join $ delayed SeqUnlift *** Exception: version (...) /= storageVersion (0) ...
However, it does with the SeqForkUnlift strategy:>>> join $ delayed SeqForkUnlift "Hey"
-
effectful-core Effectful.Internal.Monad Create an unlifting function with the SeqForkUnlift strategy.
SeqForkUnlift :: UnliftStrategyeffectful-core Effectful.Internal.Unlift Like SeqUnlift, but all unlifted actions will be executed in a cloned environment. The main consequence is that thread local state is forked at the point of creation of the unlifting function and its modifications in unlifted actions will not affect the main thread of execution (and vice versa):
>>> import Effectful >>> import Effectful.State.Dynamic >>> :{ action :: (IOE :> es, State Int :> es) => Eff es () action = do modify @Int (+1) withEffToIO SeqForkUnlift $ \unlift -> unlift $ modify @Int (+2) modify @Int (+4) :}>>> runEff . execStateLocal @Int 0 $ action 5
>>> runEff . execStateShared @Int 0 $ action 7
Because of this it's possible to safely use the unlifting function outside of the scope of effects it captures, e.g. by creating an IO action that executes effectful operations and running it later:>>> :{ delayed :: UnliftStrategy -> IO (IO String) delayed strategy = runEff . evalStateLocal "Hey" $ do r <- withEffToIO strategy $ \unlift -> pure $ unlift get modify (++ "!!!") pure r :}This doesn't work with the SeqUnlift strategy because when the returned action runs, State is no longer in scope:>>> join $ delayed SeqUnlift *** Exception: version (...) /= storageVersion (0) ...
However, it does with the SeqForkUnlift strategy:>>> join $ delayed SeqForkUnlift "Hey"