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.

  1. callForward :: Serializable a => (a -> (ProcessId, c)) -> Match c

    distributed-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.

  2. type LogFormat = String -> Process String

    distributed-process-extras Control.Distributed.Process.Extras.SystemLog

    No documentation available.

  3. addFormatter :: Addressable r => r -> Closure (Message -> Process (Maybe String)) -> Process ()

    distributed-process-extras Control.Distributed.Process.Extras.SystemLog

    No documentation available.

  4. sleepFor :: Int -> TimeUnit -> Process ()

    distributed-process-extras Control.Distributed.Process.Extras.Timer

    Literate way of saying sleepFor 3 Seconds.

  5. tryForkProcess :: LocalNode -> Process () -> IO ProcessId

    distributed-process-systest Control.Distributed.Process.SysTest.Utils

    No documentation available.

  6. BeforeNonBlank :: Doc a -> Doc a

    doctemplates Text.DocTemplates

    Doc that renders only before nonblank.

  7. SeqForkUnlift :: UnliftStrategy

    effectful-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"
    

  8. SeqForkUnlift :: UnliftStrategy

    effectful-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"
    

  9. seqForkUnliftIO :: forall (es :: [Effect]) a . HasCallStack => Env es -> ((forall r . () => Eff es r -> IO r) -> IO a) -> IO a

    effectful-core Effectful.Internal.Monad

    Create an unlifting function with the SeqForkUnlift strategy.

  10. SeqForkUnlift :: UnliftStrategy

    effectful-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"
    

Page 1295 of many | Previous | Next