Send Beginners mailing list submissions to beginners@haskell.org To subscribe or unsubscribe via the World Wide Web, visit http://www.haskell.org/mailman/listinfo/beginners or, via email, send a message with subject or body 'help' to beginners-requ...@haskell.org
You can reach the person managing the list at beginners-ow...@haskell.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Beginners digest..." Today's Topics: 1. Re: best performance with foldl (David Johnson) ---------------------------------------------------------------------- Message: 1 Date: Sun, 6 Oct 2013 08:28:39 -0500 From: David Johnson <djohnso...@gmail.com> To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell <beginners@haskell.org> Subject: Re: [Haskell-beginners] best performance with foldl Message-ID: <CAAWB79h7FVSKG903FQUUJC=ygfc0kxja1fbqlca+wxx0nvf...@mail.gmail.com> Content-Type: text/plain; charset="iso-8859-1" Roland, in this case using the strict version of foldl' would give you better performance, but to really reach C speed equivalence, I would check out the vector package and read the stream fusion article. Here is an example that fits your scenario: https://gist.github.com/dmjio/6166076 On Sun, Oct 6, 2013 at 6:38 AM, Roland Lei?a <lei...@cs.uni-saarland.de>wrote: > Hi all, > > for a benchmark I'd like to write code like this: > foldl (+) [0 100000000] > > how do I get the best performance out of it? However, It is important for > me > to rely on a higher-order function. Is it possible to be en par with the C > version? > int64_t result = 0; > for (int64_t i = 0; i <= 100000000; ++i) > result += i; > > Many thanks in advance for helping out, > Roland > > _______________________________________________ > Beginners mailing list > Beginners@haskell.org > http://www.haskell.org/mailman/listinfo/beginners > -- Cell: 1.630.740.8204 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://www.haskell.org/pipermail/beginners/attachments/20131006/0d326824/attachment-0001.html> ------------------------------ Subject: Digest Footer _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners ------------------------------ End of Beginners Digest, Vol 64, Issue 11 *****************************************