[Haskell-cafe] Library function for map+append

Dusan Kolar kolar at fit.vutbr.cz
Tue Aug 18 07:40:33 EDT 2009


Dlists maybe good it all the app is written using them. Probably not 
good idea to switch to them in the middle of project...

I know it is lazy, but I don't think it is able to eliminate operations, 
is it?

At least intuitively, the map f list takes n*C ticks (C is for 
application of f and list "creation", n is the list length, f is of no 
importance, it is always the same, but list probably must be created due 
to ++).

Then, (++) take n*K ticks (K for list creation - I want to write out the 
list at the end, so that it is created).

In my case (mapapp), it is n*CK, where CK stands for f and list 
creation... the CK is very similar to C... Thus, I should save the n*K, 
or at least its large portion... shouldn't I?  If not, how the compiler 
can eliminate the operations?

Dusan

Bulat Ziganshin wrote:
> Hello Dusan,
>
> Tuesday, August 18, 2009, 2:50:38 PM, you wrote:
>
>   
>>   but with less efficiency. Or am I wrong?
>>     
>
> probably wrong. haskell is lazy language
>
> also there is differential lists (dlist) implementation on hackage
>
>
>   



More information about the Haskell-Cafe mailing list