[Haskell-cafe] list comprehansion performance has hug different

Rustom Mody rustompmody at gmail.com
Wed Jan 30 17:41:14 CET 2013


On Wed, Jan 30, 2013 at 5:32 PM, Junior White <efiish at gmail.com> wrote:

>
>
> Thanks for your reply!  I must learn more to fully understand what's going
> on inside the list comprehension.
> But when I frist learn Haskell, it says sequence doesn't matter, but now
> it is a big matter, can compiler do some thing for us? I think this
> behavior is not friendly to newbies like me, I will take a very long time
> to work through it.
>

Good point.  Being a programmer means having to juggle many hats -- two
important ones being the mathematician-hat and the machine-hat, also called
declaration and 'imperation'  Get only the first and your programs will run
very inefficiently.  Get only the second and your program will have bugs.

Specifically in the case of list comprehensions the newbie needs
- to practice thinking of the comprehension like a set comprehension and
ignoring computation sequences
- to practice thinking of comprehension in terms of map/filter etc ie
operationally

Both views are needed.
Rusi
-- 
http://www.the-magus.in
http://blog.languager.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130130/7bb3ae6c/attachment.htm>


More information about the Haskell-Cafe mailing list