Re: [Haskell-cafe] a parallel mapM?

2012-10-07 Thread Ozgur Akgun
Hi, On 3 October 2012 19:23, Ryan Newton rrnew...@gmail.com wrote: That said, I don't see a reason for not including a separate version of runParIO :: ParIO a - IO a for non-deterministic computations. It seems really useful! Exactly. I should have been more explicit but that's what I

Re: [Haskell-cafe] a parallel mapM?

2012-10-03 Thread Ryan Newton
Several of the monad-par schedulers COULD provide a MonadIO instance and thus liftIO, which would make them easy to use for this kind of parallel IO business: http://hackage.haskell.org/packages/archive/monad-par/0.3/doc/html/Control-Monad-Par-Scheds-Direct.html And that would be a little more

Re: [Haskell-cafe] a parallel mapM?

2012-10-03 Thread Clark Gaebel
I'm not sure that exposing a liftIO for Monad.Par is the best idea. Since all these parallel computations use runPar :: Par a - a, it advertises that the result is deterministic. I'm not really comfortable with a hidden unsafePerformIO hiding in the background. That said, I don't see a reason for

Re: [Haskell-cafe] a parallel mapM?

2012-10-03 Thread Ryan Newton
That said, I don't see a reason for not including a separate version of runParIO :: ParIO a - IO a for non-deterministic computations. It seems really useful! Exactly. I should have been more explicit but that's what I meant about adding another module. You would import

[Haskell-cafe] a parallel mapM?

2012-09-28 Thread Greg Fitzgerald
I'm new to concurrent programming in Haskell. I'm looking for a drop-in replacement for 'mapM' to parallelize a set of independent IO operations. I hoped 'mapConcurrently' might be it, but I need something that will only spawn as many threads as I have CPUs available [1]. I also tried

Re: [Haskell-cafe] a parallel mapM?

2012-09-28 Thread Patrick Mylund Nielsen
Check out the parallel combinators in parallel-io: http://hackage.haskell.org/packages/archive/parallel-io/0.3.2/doc/html/Control-Concurrent-ParallelIO-Global.html On Fri, Sep 28, 2012 at 1:01 PM, Greg Fitzgerald gari...@gmail.com wrote: I'm new to concurrent programming in Haskell. I'm

Re: [Haskell-cafe] a parallel mapM?

2012-09-28 Thread Claude Heiland-Allen
On 28/09/12 19:58, Patrick Mylund Nielsen wrote: Check out the parallel combinators in parallel-io: http://hackage.haskell.org/packages/archive/parallel-io/0.3.2/doc/html/Control-Concurrent-ParallelIO-Global.html also

Re: [Haskell-cafe] a parallel mapM?

2012-09-28 Thread Greg Fitzgerald
Check out the parallel combinators in parallel-io: Cool, that's the library I'm looking for! I see it uses 'numCapabilities' to get the command-line value for '-N' and not 'getNumCapabilities' to query the system for how many cores are available. So using the 'Local' module, this works:

Re: [Haskell-cafe] a parallel mapM?

2012-09-28 Thread Alexander Solla
On Fri, Sep 28, 2012 at 11:01 AM, Greg Fitzgerald gari...@gmail.com wrote: I also tried Control.Parallel.Strategies [2]. While that route works, I had to use unsafePerformIO. Considering that IO is for sequencing effects and my IO operation doesn't cause any side-effects (besides hogging a