From abcfc36e5458b4b9c19a3f1c0fb49154ab8b479c Mon Sep 17 00:00:00 2001 From: sof Date: Thu, 14 Jan 1999 18:21:51 +0000 Subject: [PATCH] [project @ 1999-01-14 18:21:49 by sof] Haskell 98 related changes + the addition of the MVar primop, isEmptyMVar :: MVar a -> IO Bool -- use with care. --- ghc/lib/concurrent/Channel.lhs | 2 +- ghc/lib/concurrent/ChannelVar.lhs | 6 +++--- ghc/lib/concurrent/Merge.lhs | 4 ++-- ghc/lib/concurrent/SampleVar.lhs | 12 ++++++------ ghc/lib/concurrent/Semaphore.lhs | 12 ++++++------ 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/ghc/lib/concurrent/Channel.lhs b/ghc/lib/concurrent/Channel.lhs index ec87479..f9293c5 100644 --- a/ghc/lib/concurrent/Channel.lhs +++ b/ghc/lib/concurrent/Channel.lhs @@ -111,6 +111,6 @@ getChanContents ch ------------- writeList2Chan :: Chan a -> [a] -> IO () -writeList2Chan ch ls = sequence (map (writeChan ch) ls) +writeList2Chan ch ls = sequence_ (map (writeChan ch) ls) \end{code} diff --git a/ghc/lib/concurrent/ChannelVar.lhs b/ghc/lib/concurrent/ChannelVar.lhs index 5a7db0e..50c893c 100644 --- a/ghc/lib/concurrent/ChannelVar.lhs +++ b/ghc/lib/concurrent/ChannelVar.lhs @@ -11,9 +11,9 @@ module ChannelVar ( {- abstract -} CVar, - newCVar, --:: IO (CVar a) - writeCVar, --:: CVar a -> a -> IO () - readCVar, --:: CVar a -> IO a + newCVar, -- :: IO (CVar a) + writeCVar, -- :: CVar a -> a -> IO () + readCVar, -- :: CVar a -> IO a MVar ) where diff --git a/ghc/lib/concurrent/Merge.lhs b/ghc/lib/concurrent/Merge.lhs index 39f1c4c..706f0e6 100644 --- a/ghc/lib/concurrent/Merge.lhs +++ b/ghc/lib/concurrent/Merge.lhs @@ -10,8 +10,8 @@ IO monad. module Merge ( - mergeIO, --:: [a] -> [a] -> IO [a] - nmergeIO --:: [[a]] -> IO [a] + mergeIO, -- :: [a] -> [a] -> IO [a] + nmergeIO -- :: [[a]] -> IO [a] ) where import Semaphore diff --git a/ghc/lib/concurrent/SampleVar.lhs b/ghc/lib/concurrent/SampleVar.lhs index 53199a6..75476b6 100644 --- a/ghc/lib/concurrent/SampleVar.lhs +++ b/ghc/lib/concurrent/SampleVar.lhs @@ -19,13 +19,13 @@ potentially, wakes up a blocked reader (same as for @putMVar@ on empty @MVar@). \begin{code} module SampleVar ( - SampleVar, --:: type _ = + SampleVar, -- :: type _ = - newEmptySampleVar, --:: IO (SampleVar a) - newSampleVar, --:: a -> IO (SampleVar a) - emptySampleVar, --:: SampleVar a -> IO () - readSampleVar, --:: SampleVar a -> IO a - writeSampleVar --:: SampleVar a -> a -> IO () + newEmptySampleVar, -- :: IO (SampleVar a) + newSampleVar, -- :: a -> IO (SampleVar a) + emptySampleVar, -- :: SampleVar a -> IO () + readSampleVar, -- :: SampleVar a -> IO a + writeSampleVar -- :: SampleVar a -> a -> IO () ) where diff --git a/ghc/lib/concurrent/Semaphore.lhs b/ghc/lib/concurrent/Semaphore.lhs index 9fc8a0b..e7bd0d4 100644 --- a/ghc/lib/concurrent/Semaphore.lhs +++ b/ghc/lib/concurrent/Semaphore.lhs @@ -11,15 +11,15 @@ module Semaphore {- abstract -} QSem, - newQSem, --:: Int -> IO QSem - waitQSem, --:: QSem -> IO () - signalQSem, --:: QSem -> IO () + newQSem, -- :: Int -> IO QSem + waitQSem, -- :: QSem -> IO () + signalQSem, -- :: QSem -> IO () {- abstract -} QSemN, - newQSemN, --:: Int -> IO QSemN - waitQSemN, --:: QSemN -> Int -> IO () - signalQSemN --:: QSemN -> Int -> IO () + newQSemN, -- :: Int -> IO QSemN + waitQSemN, -- :: QSemN -> Int -> IO () + signalQSemN -- :: QSemN -> Int -> IO () ) where -- 1.7.10.4