I'm working on modernizing Rosetta Code's infrastructure. Starting with communications. Please accept this time-limited open invite to RC's Slack.. --Michael Mol (talk) 20:59, 30 May 2020 (UTC)

Talk:Burrows–Wheeler transform

From Rosetta Code

Haskell foldr -> iterate edit worthwhile ?[edit]

I have often learned from Spoon!'s useful Haskell edits, not least to always consider using iterate.

On this occasion, I suspect that I may be missing something ?

The 2019 March 25 (Globules -> Spoon!) edit rewrites foldr f to iterate g !! length (where the f to g rewrite is a type-change – the pruning out of an accumulator argument).

Perhaps under the influence of Graham Hutton's tutorial on the universality and expressiveness of fold I tend to think of foldr as something fairly clean and fundamental, and this particular use of iterate appears, at first glance, to risk entailing some cost, with (!!) and length, which might not be offset by dispensing with an accumulator argument, but perhaps I am missing a point about fusion and laziness here ? Hout (talk) 13:11, 25 March 2019 (UTC)