+{-
%
% (c) The GRASP/AQUA Project, Glasgow University, 1995
%
IO monad.
\begin{code}
+-}
module Merge
(
import PreludeGlaST
import Concurrent ( forkIO )
-import PreludePrimIO ( newEmptyMVar, newMVar, putMVar,
- readMVar, takeMVar, _MVar
- )
-\end{code}
-
-\begin{code}
max_buff_size = 1
return val
type Buffer a
- = (_MVar (_MVar [a]), QSem)
+ = (MVar (MVar [a]), QSem)
-suckIO :: _MVar Int -> Buffer a -> [a] -> IO ()
+suckIO :: MVar Int -> Buffer a -> [a] -> IO ()
suckIO branches_running buff@(tail_list,e) vs
= case vs of
return val
where
mapIO f xs = accumulate (map f xs)
-\end{code}
-
-So as to avoid creating a mutual recursive module dep. with @Concurrent.lhs@,
-the defn. of @forkIO@ is duplicated here:
-
-\begin{code}
-{- HAH! WDP 95/07
-
-forkIO :: PrimIO a -> PrimIO a
-forkIO action s
- = let
- (r, new_s) = action s
- in
- new_s `_fork_` (r, s)
- where
- _fork_ x y = case (fork# x) of { 0# -> parError#; _ -> y }
--}
#endif {- __CONCURRENT_HASKELL__ -}
-
-\end{code}