> * document laziness of commuter functions and slightly improve
commuterRLFL
Looks fine. I don't think I'd thought about laziness issues with
these functions before. But for the Id/List functions, I think
the behaviour is inevitable with the variants that aren't lazy
given the structure of the input; even if we don't have a large
unevaluated thunk we'll still be storing the full list, so there's
no asymptotic improvement to be had, unlike with foldl' (+) where
the result is constant size.
If we wanted to be sure commuterRLFL retains its new properties we'd
need to write some tests.
|