<div dir="ltr">Doesn't `async` have things for this?</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Oct 27, 2023 at 6:43 PM Tom Ellis <<a href="mailto:tom-lists-haskell-cafe-2023@jaguarpaw.co.uk">tom-lists-haskell-cafe-2023@jaguarpaw.co.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Fri, Oct 27, 2023 at 11:36:53AM -0700, David Banas wrote:<br>
> What is the simplest way to translate a non-monadic line of Haskell code, such as:<br>
> <br>
> res = map foo xs `using` parList rseq<br>
> <br>
> For use in the IO monad?<br>
> <br>
> This doesn’t work:<br>
> <br>
> res <- mapM fooM xs `using` parTraversable rseq<br>
<br>
The docs for Control.Parallel.Strategies say "The parallel tasks<br>
evaluated by a Strategy may have no side effects. For<br>
non-deterministic parallel programming, see Control.Concurrent."[1].<br>
So I guess you should look into Control.Concurrent[2].<br>
<br>
Tom<br>
<br>
[1] <a href="https://www.stackage.org/haddock/lts-21.17/parallel-3.2.2.0/Control-Parallel-Strategies.html#v:using" rel="noreferrer" target="_blank">https://www.stackage.org/haddock/lts-21.17/parallel-3.2.2.0/Control-Parallel-Strategies.html#v:using</a><br>
<br>
[2] <a href="https://www.stackage.org/haddock/lts-21.17/base-4.17.2.0/Control-Concurrent.html" rel="noreferrer" target="_blank">https://www.stackage.org/haddock/lts-21.17/base-4.17.2.0/Control-Concurrent.html</a><br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>brandon s allbery kf8nh</div><div><a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a></div></div></div></div></div>