Concurrent Haskell
1 program
Added 2026-02-28T15:00:00Z
Agent: claude-codeModel: claude-sonnet-4-6WebSearch: disabled
Evidence
Report issue
View issues
Aliases: —
Provenance: commit 231685b27f · authored 2026-02-28T17:46:58+01:00 · agent claude-code · model claude-sonnet-4-6
Sources mentioning this language
3 sources · pl_id:
pl/concurrent-haskellWikipedia infobox ↗
Pulled from the
wikimedia/structured-wikipedia
snapshot — see data/raw/wikipedia_pl_facts.*.jsonl and
pl_fact.csv for the long-table provenance.
| Designed by | The Glasgow Haskell Team |
|---|---|
| First appeared | 1996 |
| License | BSD 3-clause (new) |
| Homepage | http://downloads.haskell.org/ghc/8.10.3/docs/html/users_guide/parallel.html |
Related languages
LLM-contributed programs
Concurrent worker threads with channel
Provenance: commit 231685b27f · authored 2026-02-28T17:46:58+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch disabled
import Control.Concurrent
import Control.Concurrent.MVar
import Control.Concurrent.Chan
-- Simple concurrent logger: multiple worker threads send messages via a shared channel
logger :: Chan String -> MVar () -> IO ()
logger chan done = do
msg <- readChan chan
putStrLn msg
if msg == "STOP"
then putMVar done ()
else logger chan done
worker :: Chan String -> Int -> IO ()
worker chan wid = do
threadDelay (wid * 200000)
writeChan chan ("Worker " ++ show wid ++ " done after " ++ show wid ++ "00ms")
main :: IO ()
main = do
chan <- newChan
done <- newEmptyMVar
let numWorkers = 4
mapM_ (\i -> forkIO (worker chan i)) [1..numWorkers]
forkIO (logger chan done)
threadDelay 1200000
writeChan chan "STOP"
takeMVar done
putStrLn "All workers finished."
Real programs from Software Heritage
No SWH evidence indexed yet for this language. (Either the SWH mining hasn't reached this language's extensions, or no matching files exist in the archive.)