[Haskell-cafe] parallel Haskell

Dennis Raddle dennis.raddle at gmail.com
Fri Jul 7 05:06:36 UTC 2017


thanks for the tip, that book is great... I'm reading it now, and it's an
easy read, very clear explanations of laziness. I never understood laziness
all that well before.

D

On Thu, Jul 6, 2017 at 10:34 AM, Rein Henrichs <rein.henrichs at gmail.com>
wrote:

> Please take a look at Simon Marlow's free book, *Parallel and Concurrent
> Programming in Haskell* (http://chimera.labs.oreilly.com/books/
> 1230000000929). It will teach you a lot about... the things in the title.
>
> On Thu, Jul 6, 2017 at 10:21 AM Claude Heiland-Allen <claude at mathr.co.uk>
> wrote:
>
>> Hi Dennis,
>>
>> On 06/07/17 17:53, Dennis Raddle wrote:
>> > I have a program which does backtracking search in a recursive
>> > function.  I followed the chapter in "Real World Haskell" to
>> parallelize it.
>> [snip]
>> > There's no effect from the R.W.H. ideas. Can I get some suggestions as
>> > to why?
>>
>> You can get timing and other useful diagnostics by compiling with
>> -rtsopts and running with +RTS -s, no need to measure CPU time in your
>> own program.
>>
>> > force :: [a] -> ()
>> > force xs = go xs `pseq` ()
>> >   where go (_:xs) = go xs
>> >         go [] = 1
>>
>> This force doesn't do enough, it just walks the spine. Try this, which
>> forces the elements as well as the shape:
>>
>> force :: [a] -> ()
>> force xs = go xs `pseq` ()
>>   where go (x:xs) = x `pseq` go xs
>>         go [] = 1
>>
>> Thanks,
>>
>>
>> Claude
>> --
>> https://mathr.co.uk
>> _______________________________________________
>> Haskell-Cafe mailing list
>> To (un)subscribe, modify options or view archives go to:
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>> Only members subscribed via the mailman list are allowed to post.
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20170706/9e0f4e25/attachment.html>


More information about the Haskell-Cafe mailing list