Modulemonad-par-0.3.6Haskell98
Control.Monad.Par.Scheds.TraceInternal
This module exposes the internals of the Par monad so that you
can build your own scheduler or other extensions. Do not use this
module for purposes other than extending the Par monad with new
functionality.
- 6 types
- 13 values
- Packagemonad-par-0.3.6
- Exports19
- LanguageHaskell98
- LicenceBSD-3-Clause
- SourceTraceInternal.hs
Instances6Monad, Functor, MonadFix, Applicative, ParFuture, ParIVar
Monad ParDefined in monad-par-0.3.6 · Control.Monad.Par.Scheds.TraceInternalFunctor ParDefined in monad-par-0.3.6 · Control.Monad.Par.Scheds.TraceInternalMonadFix ParDefined in monad-par-0.3.6 · Control.Monad.Par.Scheds.TraceInternalApplicative ParDefined in monad-par-0.3.6 · Control.Monad.Par.Scheds.TraceInternalParFuture IVar ParDefined in monad-par-0.3.6 · Control.Monad.Par.Scheds.Trace · orphanParIVar IVar ParDefined in monad-par-0.3.6 · Control.Monad.Par.Scheds.Trace · orphan
Constructors
IVar (IORef (IVarContents a))
Instances6ParFuture, ParIVar, Eq, NFData
ParFuture IVar ParIODefined in monad-par-0.3.6 · Control.Monad.Par.IOParFuture IVar ParDefined in monad-par-0.3.6 · Control.Monad.Par.Scheds.Trace · orphanParIVar IVar ParIODefined in monad-par-0.3.6 · Control.Monad.Par.IOParIVar IVar ParDefined in monad-par-0.3.6 · Control.Monad.Par.Scheds.Trace · orphanEq (IVar a)Defined in monad-par-0.3.6 · Control.Monad.Par.Scheds.TraceInternalEquality for IVars is physical equality, as with other reference types.
NFData (IVar a)Defined in monad-par-0.3.6 · Control.Monad.Par.Scheds.TraceInternal
The main scheduler loop.
Run a parallel, deterministic computation and return its result.
Note: you must NOT return an IVar in the output of the parallel
computation. This is unfortunately not enforced, as it is with
runST or with newer libraries that export a Par monad, such as
lvish.
A version that avoids an internal unsafePerformIO for calling contexts that are already in the IO monad.
Returning any value containing IVar is still disallowed, as it can compromise type safety.
An asynchronous version in which the main thread of control in a Par computation can return while forked computations still run in the background.
Creates a new IVar
Creates a new IVar that contains a value
Creates a new IVar that contains a value (head-strict only)
Read the value in an IVar. The get operation can only return when the
value has been written by a prior or parallel put to the same
IVar.
Like put, but only head-strict rather than fully-strict.
Put a value into an IVar. Multiple puts to the same IVar
are not allowed, and result in a runtime error.
put fully evaluates its argument, which therefore must be an
instance of NFData. The idea is that this forces the work to
happen when we expect it, rather than being passed to the consumer
of the IVar and performed later, which often results in less
parallelism than expected.
Sometimes partial strictness is more appropriate: see put_.
Allows other parallel computations to progress. (should not be necessary in most cases).
Take the monadic fixpoint of a Par computation. This is the definition of mfix for Par. Throws FixParException if the result is demanded strictly within the computation.
Instances2Show, Exception
Show FixParExceptionDefined in monad-par-0.3.6 · Control.Monad.Par.Scheds.TraceInternalException FixParExceptionDefined in monad-par-0.3.6 · Control.Monad.Par.Scheds.TraceInternal