Re:Toolz: A functional standard library for Python
by AlexCoventry on Thursday January 21, 2021 @02:29PM
(#25863045)
Also by the lack of persistent data structures with structural sharing. That forces you to take an expensive copy whenever you want a modified version of some data, or bash it in place.
[ Parent
| on HN ]
Re:Toolz: A functional standard library for Python
by heavyset_go on Thursday January 21, 2021 @02:49PM
(#25863267)
There's Pyrsistent[1], which provides persistent data structures.
Re:Toolz: A functional standard library for Python
by Iwan-Zotow on Thursday January 21, 2021 @02:34PM
(#25863099)
Isn't it a true functional way?
Re:Toolz: A functional standard library for Python
by alentist on Thursday January 21, 2021 @04:36PM
(#25864612)
There are smarter ways to deal with data structures in the functional setting than copying the entire structure over and over again.
See https://en.wikipedia.org/wiki/Purely_functional_data_structu... and Okasaki’s book Purely Functional Data Structures.
Re:Toolz: A functional standard library for Python
by iimblack on Thursday January 21, 2021 @04:13PM
(#25864311)
I could definitely be wrong but I think most functional data structures aren’t fully copied. Instead, they’ll utilize something like a pointer to the data that stayed the same so only the part that changes is “copied”.