Patch 1726 document laziness of commuter functions and slightly i...

Title document laziness of commuter functions and slightly i...
Superseder Nosy List bf
Related Issues
Status accepted Assigned To

Created on 2018-09-11.22:28:48 by bf, last changed 2018-10-17.06:47:20 by ganesh.

File name Status Uploaded Type Edit Remove
document-laziness-of-commuter-functions-and-slightly-improve-commuterrlfl.dpatch bf, 2018-09-11.22:28:47 application/x-darcs-patch
patch-preview.txt bf, 2018-09-11.22:28:47 text/x-darcs-patch
unnamed bf, 2018-09-11.22:28:47 text/plain
See mailing list archives for discussion on individual patches.
msg20301 (view) Author: bf Date: 2018-09-11.22:28:47
In addition, I think that the non-lazy versions should either be re-written
so that their result lists can be consumed lazily or else they should use a
strict accumulator in order to avoid building up large unevaluated
expressions. This is exactly the same situation as for foldl vs. foldl'.

1 patch for repository http://darcs.net/screened:

patch 8729af8cea4e67e3582d17fac1a08b988d45b1f3
Author: Ben Franksen <ben.franksen@online.de>
Date:   Tue Sep 11 20:40:16 CEST 2018
  * document laziness of commuter functions and slightly improve commuterRLFL
  The result lists of commuterRLFL are now produced in an alternating fashion,
  so that both can be consumed lazily (from head to tail).
msg20389 (view) Author: ganesh Date: 2018-10-09.17:37:42
>   * document laziness of commuter functions and slightly improve 

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.
Date User Action Args
2018-09-11 22:28:48bfcreate
2018-09-14 21:04:46bfsetstatus: needs-screening -> needs-review
2018-10-09 17:37:44ganeshsetstatus: needs-review -> accepted-pending-tests
messages: + msg20389
2018-10-17 06:47:20ganeshsetstatus: accepted-pending-tests -> accepted