[Haskell-beginners] List operations

jianqiuchi at gmail.com jianqiuchi at gmail.com
Thu May 19 16:30:24 CEST 2011


OK, I see. Thanks a lot.

Cheers, =)

,Felipe Almeida Lessa <felipe.lessa at gmail.com>撰写:
> On Thu, May 19, 2011 at 11:05 AM, jianqiuchi at gmail.com> wrote:

> > I have a question about the cost of list comprehension and map function.

> >

> > For example, I have a list of Double and I want to do lots of  
> calculation on

> > it. There are two ways to do that:

> > 1. [x ** 3 | x
> > 2. map (flip (**) 3) list

> > I am wondering if the cost of using them could be very different and  
> why.



> List comprehensions are just syntatic sugar. You should expect both

> (1) and (2) to be exactly the same when compiling.



> Cheers, =)



> --

> Felipe.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20110519/06fd5928/attachment.htm>


More information about the Beginners mailing list