Scheduling may be either pre-emptive or co-operative,
depending on the implementation of Concurrent Haskell (see below
- for imformation related to specific compilers). In a co-operative
+ for information related to specific compilers). In a co-operative
system, context switches only occur when you use one of the
primitives defined in this module. This means that programs such
as:
a thread may be pre-empted whenever it allocates some memory,
which unfortunately means that tight loops which do no
allocation tend to lock out other threads (this only seems to
- happen with pathalogical benchmark-style code, however).
+ happen with pathological benchmark-style code, however).
The rescheduling timer runs on a 20ms granularity by
default, but this may be altered using the
fromDynamic
:: Typeable a
=> Dynamic -- ^ the dynamically-typed object
- -> Maybe a -- ^ returns: @'Just' a@, if the dyanmically-typed
+ -> Maybe a -- ^ returns: @'Just' a@, if the dynamically-typed
-- object has the correct type (and @a@ is its value),
-- or 'Nothing' otherwise.
fromDynamic (Dynamic t v) =
-- key.
intersectFM :: (Ord key OUTPUTABLE_key) => FiniteMap key elt -> FiniteMap key elt -> FiniteMap key elt
--- | Returns the interesction of two mappings, using the specified
+-- | Returns the intersection of two mappings, using the specified
-- combination function to combine values.
intersectFM_C :: (Ord key OUTPUTABLE_key) => (elt1 -> elt2 -> elt3)
-> FiniteMap key elt1 -> FiniteMap key elt2 -> FiniteMap key elt3
-- | Bottom-up synthesis of a data structure;
-- 1st argument z is the initial element for the synthesis;
-- 2nd argument o is for reduction of results from subterms;
--- 3rd argument f updates the sythesised data according to the given term
+-- 3rd argument f updates the synthesised data according to the given term
--
synthesize :: s -> (s -> s -> s) -> GenericQ (s -> s) -> GenericQ s
synthesize z o f x = f x (foldr o z (gmapQ (synthesize z o f) x))
* joinPS (packString [x]) (splitPS x ls) = ls
-}
--- | The 'splitPS' function splits the input string on each occurance of the given 'Char'.
+-- | The 'splitPS' function splits the input string on each occurrence of the given 'Char'.
splitPS :: Char -> PackedString -> [PackedString]
splitPS c = splitWithPS (== c)
-- | Outputs a 'PackedString' to the specified 'Handle'.
--
-- NOTE: the representation of the 'PackedString' in the file is assumed to
--- be in the ISO-8859-1 encoding. In other words, only the least signficant
+-- be in the ISO-8859-1 encoding. In other words, only the least significant
-- byte is taken from each character in the 'PackedString'.
hPutPS :: Handle -> PackedString -> IO ()
hPutPS h (PS ps) = do
-- the action and use it after the action completes. All uses
-- of the pointer should be inside the
-- 'withForeignPtr' bracket. The reason for
--- this unsafety is the same as for
+-- this unsafeness is the same as for
-- 'unsafeForeignPtrToPtr' below: the finalizer
-- may run earlier than expected, because the compiler can only
-- track usage of the 'ForeignPtr' object, not
-- pointers. In fact, they need not even be valid memory addresses. The only
-- guarantee provided is that if they are passed back to Haskell land, the
-- function 'deRefStablePtr' will be able to reconstruct the
--- Haskell value refereed to by the stable pointer.
+-- Haskell value referred to by the stable pointer.
boils down to translating Haskell data structures into the binary
representation of a corresponding data structure of the foreign
language and vice versa. To code this marshalling in Haskell, it is
-necessary to manipulate primtive data types stored in unstructured
+necessary to manipulate primitive data types stored in unstructured
memory blocks. The class 'Storable' facilitates this manipulation on
all types for which it is instantiated, which are the standard basic
types of Haskell, the fixed size @Int@ types ('Int8', 'Int16',
-- ^This function extracts the pointer component of a foreign
-- pointer. This is a potentially dangerous operations, as if the
-- argument to 'unsafeForeignPtrToPtr' is the last usage
--- occurence of the given foreign pointer, then its finaliser(s) will
+-- occurrence of the given foreign pointer, then its finaliser(s) will
-- be run, which potentially invalidates the plain pointer just
-- obtained. Hence, 'touchForeignPtr' must be used
-- wherever it has to be guaranteed that the pointer lives on - i.e.,
finalizer to run earlier than you intended. The same motivation
justifies the existence of
'Control.Concurrent.MVar.addMVarFinalizer' and
- 'Data.IORef.mkWeakIORef' (the non-unformity is accidental).
+ 'Data.IORef.mkWeakIORef' (the non-uniformity is accidental).
-}
addFinalizer :: key -> IO () -> IO ()
addFinalizer key finalizer = do
-- Operations over ReadPrec
lift :: ReadP a -> ReadPrec a
--- ^ Lift a predence-insensitive 'ReadP' to a 'ReadPrec'
+-- ^ Lift a precedence-insensitive 'ReadP' to a 'ReadPrec'
lift m = P (\_ -> m)
step :: ReadPrec a -> ReadPrec a
mkRegex s = unsafePerformIO (RE.regcomp s RE.regExtended)
-- | Makes a regular expression, where the multi-line and
--- case-sensitve options can be changed from the default settings.
+-- case-sensitive options can be changed from the default settings.
mkRegexWithOpts
:: String -- ^ The regular expression to compile
-> Bool -- ^ 'True' @\<=>@ @\'^\'@ and @\'$\'@ match the beginning and