Safe Haskell | Unsafe |
---|
This module is not Safe Haskell; as an end-user, you shouldn't ever need to import it.
It is exposed only because it is necessary for implementing new LVar types that will live in their own, separate packages.
Type-safe wrappers around internal components
The type of parallel computations. A computation Par d s a
may or may not be
deterministic based on the setting of the d
parameter (of kind Determinism
).
The s
parameter is for preventing the escape of LVar
s from Par
computations
(just like the ST
monad).
Implementation note: This is a wrapper around the internal Par
type, only with more type parameters.
newtype LVar s all delt Source
The generic representation of LVars used by the scheduler. The end-user can't actually do anything with these and should not try to.
WrapLVar | |
|
data Determinism Source
This datatype is promoted to type-level (DataKinds
extension)
and used to indicate whether a Par
computation is
guaranteed-deterministic, or only quasi-deterministic (i.e., might
throw NonDeterminismExn
).
Show Determinism |
Unsafe conversions and lifting
unWrapPar :: Par d s a -> Par aSource
Unsafe: drops type information to go from the safe Par
monad to
the internal, dangerous one.
unsafeRunPar :: Par d s a -> aSource
This is cheating! It pays no attention to session sealing (s
) or to the
determinism level (d
).
unsafeConvert :: Par d1 s1 a -> Par d2 s2 aSource
Ignore the extra type annotations regarding both determinism and session-sealing.