summaryrefslogtreecommitdiff
path: root/lore/Control/Concurrent/Sima.hs
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2019-02-24 12:36:48 -0800
committerBen Sima <ben@bsima.me>2019-02-24 12:36:48 -0800
commitf36371f324ca85100590438e45d186c9704b8140 (patch)
tree4df1254a491748776bc32f06674848b39381ae64 /lore/Control/Concurrent/Sima.hs
parentaee2750000526b0cdd658aadaf7d7500ff881ed3 (diff)
Organize/document lore modules a bit
Diffstat (limited to 'lore/Control/Concurrent/Sima.hs')
-rw-r--r--lore/Control/Concurrent/Sima.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/lore/Control/Concurrent/Sima.hs b/lore/Control/Concurrent/Sima.hs
index 3588a2a..b69c0bb 100644
--- a/lore/Control/Concurrent/Sima.hs
+++ b/lore/Control/Concurrent/Sima.hs
@@ -1,12 +1,12 @@
-module Control.Concurrent.Simaphore
+module Control.Concurrent.Sima
( mapPool
)
where
-import Control.Concurrent.MSem
+import qualified Control.Concurrent.MSem as Sem
-- | Simaphore-based throttled 'mapConcurrently'.
mapPool :: Traversable t => Int -> (a -> IO b) -> t a -> IO (t b)
-mapPool lim f xs = do
- sima <- new lim
- mapConcurrently (with sima . f) xs
+mapPool n f xs = do
+ sima <- Sem.new n
+ mapConcurrently (Sem.with sima . f) xs