Re:It never makes sense to use foldl on lists in Haskell (2019)
by toolslive on Saturday March 21, 2020 @06:09AM
(#22645601)
They are, but it's shallow:
And python gives you access to anything:
[ Parent
| on HN ]
Re:It never makes sense to use foldl on lists in Haskell (2019)
by didibus on Saturday March 21, 2020 @05:41PM
(#22650426)
It be shallow with a Singly Linked List too no? What inherently makes a Singly Linked List better at addressing this problem if it contains mutable elements?
Re:It never makes sense to use foldl on lists in Haskell (2019)
by toolslive on Sunday March 22, 2020 @05:39PM
(#22658944)
Typically, in a functional language, values are immutable.
So if you cons to a list, you create a new value that has the current list as its tail. Since all lists are immutable, they can be shared and there's no need for a deep copy.
Python is not a functional programming language....