Minor SampleVar refactoring
authorIan Lynagh <igloo@earth.li>
Fri, 10 Jul 2009 15:14:38 +0000 (15:14 +0000)
committerIan Lynagh <igloo@earth.li>
Fri, 10 Jul 2009 15:14:38 +0000 (15:14 +0000)
Control/Concurrent/SampleVar.hs

index 69c29c2..bdf5eac 100644 (file)
@@ -61,8 +61,7 @@ newEmptySampleVar = do
 -- |Build a 'SampleVar' with an initial value.
 newSampleVar :: a -> IO (SampleVar a)
 newSampleVar a = do
-   v <- newEmptyMVar
-   putMVar v a
+   v <- newMVar a
    newMVar (1,v)
 
 -- |If the SampleVar is full, leave it empty.  Otherwise, do nothing.