[Haskell-beginners] Performance of Idiomatic lazy Haskell

Daniel Fischer daniel.is.fischer at web.de
Sun Jan 31 13:50:34 EST 2010


Am Sonntag 31 Januar 2010 19:21:10 schrieb Stephen Tetley:
> Hello Daniel
>
> I can get close with a tail recursive + accumulator monoidal unfoldr
> and strict triple for the state (leibniz4).

Beats stream fusion and direct loops comfortably here (3.55s) when compiled 
with the NCG, very narrowly when compiled via C (2.99s).
Congrats.

>
> But it does seem to be loosing the point of the initial exercise "to
> be idiomatic",

Yes. Returning to that,

a) for tasks where it's appropriate/sufficiently natural, hand-coded loops 
are idiomatic, too.

b) use stream-fusion to get rid of intermediate structures.

> also the answers are divergent too...

In how far?

>
>
> Best wishes
>
> Stephen



More information about the Beginners mailing list