Hoogle Search

Within LTS Haskell 24.36 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. forkIO :: ForkableMonad m => m a -> m ThreadId

    forkable-monad Control.Concurrent.Forkable

    Spark off a new thread to run the monadic computation passed as the first argument, and return the ThreadId of the newly created thread. The new thread will run the computation using the same monadic context as the parent thread. As a convenience, this forkIO accepts a computation returning any value, not just unit. This value is discarded when the computation terminates.

  2. forkIOWithUnmask :: ((forall a . () => IO a -> IO a) -> IO ()) -> IO ThreadId

    forkable-monad Control.Concurrent.Forkable

    Like forkIO, but the child thread is passed a function that can be used to unmask asynchronous exceptions. This function is typically used in the following way

    ... mask_ $ forkIOWithUnmask $ \unmask ->
    catch (unmask ...) handler
    
    so that the exception handler in the child thread is established with asynchronous exceptions masked, meanwhile the main body of the child thread is executed in the unmasked state. Note that the unmask function passed to the child thread should only be used in that thread; the behaviour is undefined if it is invoked in a different thread.

  3. forkOS :: IO () -> IO ThreadId

    forkable-monad Control.Concurrent.Forkable

    Like forkIO, this sparks off a new thread to run the IO computation passed as the first argument, and returns the ThreadId of the newly created thread. However, forkOS creates a bound thread, which is necessary if you need to call foreign (non-Haskell) libraries that make use of thread-local state, such as OpenGL (see Control.Concurrent#boundthreads). Using forkOS instead of forkIO makes no difference at all to the scheduling behaviour of the Haskell runtime system. It is a common misconception that you need to use forkOS instead of forkIO to avoid blocking all the Haskell threads when making a foreign call; this isn't the case. To allow foreign calls to be made without blocking all the Haskell threads (with GHC), it is only necessary to use the -threaded option when linking your program, and to make sure the foreign import is not marked unsafe.

  4. forkOSWithUnmask :: ((forall a . () => IO a -> IO a) -> IO ()) -> IO ThreadId

    forkable-monad Control.Concurrent.Forkable

    Like forkIOWithUnmask, but the child thread is a bound thread, as with forkOS.

  5. forkOn :: Int -> IO () -> IO ThreadId

    forkable-monad Control.Concurrent.Forkable

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

  6. forkOnWithUnmask :: Int -> ((forall a . () => IO a -> IO a) -> IO ()) -> IO ThreadId

    forkable-monad Control.Concurrent.Forkable

    Like forkIOWithUnmask, but the child thread is pinned to the given CPU, as with forkOn.

  7. forEachPath :: (PathElemDescr -> PathElemDescr) -> Path -> Path

    funcmp FMP.Picture

    No documentation available.

  8. forEachEdge :: (Path -> Path) -> Tree -> Tree

    funcmp FMP.Tree

    No documentation available.

  9. forEachLevelNode :: Int -> (Tree -> Tree) -> Tree -> Tree

    funcmp FMP.Tree

    No documentation available.

  10. forEachNode :: (Tree -> Tree) -> Tree -> Tree

    funcmp FMP.Tree

    No documentation available.

Page 208 of many | Previous | Next