RGFJ2XOW6NLJ7MDXATCSTRDCQJSOC2BWVH56HTYPBMQ4PWEB2T5QC
runTaskQueue chan = interpret $ \_ -> \case
Enqueue v -> writeChan chan v
Dequeue -> readChan chan
runTaskQueue eff = do
chan <- newChan
interpret (run chan) eff
where
run :: (Concurrent :> es)
=> Chan task
-> LocalEnv localEs es
-> TaskQueue task (Eff localEs) x
-> Eff es x
run chan _ = \case
Enqueue v -> writeChan chan v
Dequeue -> readChan chan