2 ms·
It's very easy to disprove this comment. Haskell is pure functional language and uses linked lists as their main list data structure. This is because it is dif
by imtringued 6y ago
It's very easy to disprove this comment.
Haskell is pure functional language and uses linked lists as their main list data structure. This is because it is difficult to modify individual elements in an array in a purely functional manner without copying the entire array. Meanwhile using arrays in C or Rust and changing individual elements is not only very easy, it's very fast as well.
The default string implementation in Haskell is built on a linked list of characters and it performs horribly, so Haskell has multiple string implementations. The default string implementation is still often used because it is more convenient. This is an example where writing more readable code also involves making it perform worse. Rephrased: Faster code is less readable in Haskell.
https://stackoverflow.com/questions/13865420/why-is-haskells-default-string-implementation-a-linked-list-of-chars https://stackoverflow.com/questions/13865420/why-is-haskells...
- centimeter 6y agoThe text type everyone uses in Haskell is Data.Text, which is packed. String is not used for anything performance-sensitive.