Proposal: Add a strictly accumulating scanl' to Data.List

Joachim Breitner wrote, in https://ghc.haskell.org/trac/ghc/ticket/9345#comment:6, a strictly accumulating version of scanl, to be named scanl'. I was initially concerned about its safety for fusion, but am now convinced of its correctness and believe it should be added to Data.List. scanl' :: (b -> a -> b) -> b -> [a] -> [b] scanl' f a bs = build $ \c n -> a `seq` a `c` foldr (\b g x -> (let b' = f x b in b' `seq` (b' `c` g b'))) (\b -> b `seq` n) bs a

There's been no response to this so far, and I'd like to get it for 7.10.1. Any opinions? Joachim Breitner wrote, in https://ghc.haskell.org/trac/ghc/ticket/9345#comment:6, a strictly accumulating version of scanl, to be named scanl'. I was initially concerned about its safety for fusion, but am now convinced of its correctness and believe it should be added to Data.List. scanl' :: (b -> a -> b) -> b -> [a] -> [b] scanl' f a bs = build $ \c n -> a `seq` a `c` foldr (\b g x -> (let b' = f x b in b' `seq` (b' `c` g b'))) (\b -> b `seq` n) bs a

Hi, Am Montag, den 27.10.2014, 19:04 -0400 schrieb David Feuer:
There's been no response to this so far, and I'd like to get it for 7.10.1. Any opinions?
I’m fine with the addition. (Generally, complete silence can be taken as mild agreement from everyone :-)) Greetings, Joachim -- Joachim “nomeata” Breitner mail@joachim-breitner.de • http://www.joachim-breitner.de/ Jabber: nomeata@joachim-breitner.de • GPG-Key: 0xF0FBF51F Debian Developer: nomeata@debian.org

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Me too. It just bothers me a bit that the 4th line's call to seq uses parenthesis while the 3rd's doesn't :).
Em 28 de outubro de 2014 07:33:43 BRST, Joachim Breitner
Hi,
Am Montag, den 27.10.2014, 19:04 -0400 schrieb David Feuer:
There's been no response to this so far, and I'd like to get it for 7.10.1. Any opinions?
I’m fine with the addition.
(Generally, complete silence can be taken as mild agreement from everyone :-))
Greetings, Joachim -- Joachim “nomeata” Breitner mail@joachim-breitner.de • http://www.joachim-breitner.de/ Jabber: nomeata@joachim-breitner.de • GPG-Key: 0xF0FBF51F Debian Developer: nomeata@debian.org
------------------------------------------------------------------------
_______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries
- -- Felipe. -----BEGIN PGP SIGNATURE----- iQJXBAEBCABBOhxGZWxpcGUgQWxtZWlkYSBMZXNzYSAobWV0ZWZpY2hhKSA8ZmVs aXBlLmxlc3NhQGdtYWlsLmNvbT4FAlRPkPoACgkQp2TRhD6WaClchxAA1uSrpFB7 eGQT+4+gTot2GGxU2JrFQSLhOthFqp/KTdK2sCU/INGGYTCoLKx5/JYt30q+1npG DGt0cgQ/5m9FEP3yl4t9/bSBj3x0pARu6DUeYNnSHX3l070/qsO9JpmvgpVtQz0N xokMPGm3BMbjJyC1+9reFwcm/o7QH3bCdoRtlajJjn253bERHNwROht3UfAYWBYp YdUcvy81QV+Tpbwk/Rj/8sGEFNAYihBJycJnRs1ZIFzY5KKw3wtINlLj8Jj8BICS KhqhBT6ZuII76+roOrm2T42p3N8GGAM7n7uIP8h3HamPNnG9B+Ur4pFrMZNc0Fvw NZN5+gilcQTCSo4NmpxtFOFvre1CYFzoXKIZhUr584F8HiI9LrN8+oF/q5lWd54V gPEmKj1yGDgAbxL6iDNznnYuEp7ulWPdh5sWVF3QsqRaCJ0HBVZthD6K9Xz0YELn zEDQELEAag2btP/uTtqtTyR5wi27EYojUi4jpGSXRTDkKRByLKgBV+XxRoOTWpTF P4h0QgJ967q/svANdSlXL3/8he65xMmp5dgPBZEjlBGbcchGObsEUiQLEPZYqh6f EUFfDWvt2MijTLKAo14h0o0fEGnXpSd2WCcGLygd2xUn4Y7piYwe15g+/Q314DQz 1h3U9MdJ8kYy1pINEtAgW3CCg6t/2/S57mc= =pwBX -----END PGP SIGNATURE-----
participants (3)
-
David Feuer
-
Felipe Lessa
-
Joachim Breitner