
31 Jan
2010
31 Jan
'10
1:50 p.m.
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