Hoogle Search
Within LTS Haskell 24.49 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
forkOSWithUnmask :: ((forall a . () => IO a -> IO a) -> IO ()) -> IO ThreadIdprotolude Protolude Like forkIOWithUnmask, but the child thread is a bound thread, as with forkOS.
forkOn :: Int -> IO () -> IO ThreadIdprotolude Protolude Like forkIO, but lets you specify on which capability the thread should run. Unlike a forkIO thread, a thread created by forkOn will stay on the same capability for its entire lifetime (forkIO threads can migrate between capabilities according to the scheduling policy). forkOn is useful for overriding the scheduling policy when you know in advance how best to distribute the threads. The Int argument specifies a capability number (see getNumCapabilities). Typically capabilities correspond to physical processors, but the exact behaviour is implementation-dependent. The value passed to forkOn is interpreted modulo the total number of capabilities as returned by getNumCapabilities. GHC note: the number of capabilities is specified by the +RTS -N option when the program is started. Capabilities can be fixed to actual processor cores with +RTS -qa if the underlying operating system supports that, although in practice this is usually unnecessary (and may actually degrade performance in some cases - experimentation is recommended).
forkOnWithUnmask :: Int -> ((forall a . () => IO a -> IO a) -> IO ()) -> IO ThreadIdprotolude Protolude Like forkIOWithUnmask, but the child thread is pinned to the given CPU, as with forkOn.
foreach :: Functor f => f a -> (a -> b) -> f bprotolude Protolude.Functor No documentation available.
forever :: Applicative f => f a -> f bprotolude Protolude.Monad Repeat an action indefinitely.
Examples
A common use of forever is to process input from network sockets, Handles, and channels (e.g. MVar and Chan). For example, here is how we might implement an echo server, using forever both to listen for client connections on a network socket and to echo client input on client connection handles:echoServer :: Socket -> IO () echoServer socket = forever $ do client <- accept socket forkFinally (echo client) (\_ -> hClose client) where echo :: Handle -> IO () echo client = forever $ hGetLine client >>= hPutStrLn client
Note that "forever" isn't necessarily non-terminating. If the action is in a MonadPlus and short-circuits after some number of iterations. then forever actually returns mzero, effectively short-circuiting its caller.-
reflex Data.FastMutableIntMap Runs the provided action over the intersection of a FastMutableIntMap and an IntMap
for_ :: MonadIO m => FastMutableIntMap a -> (a -> m ()) -> m ()reflex Data.FastMutableIntMap Runs the provided action over the values of a FastMutableIntMap
formatCostCentreTree :: CostCentreTree -> IO Stringreflex Reflex.Profiled No documentation available.
-
reflex Reflex.Requester.Base traverseRequesterData with its arguments flipped
-
reflex Reflex.Requester.Base.Internal traverseRequesterData with its arguments flipped