The fact that Haskell\'s default String
implementation is not efficient both in terms of speed and memory is well known. As far as I know the [] lists
Why is Haskell's default String implementation a singly-linked list
Because singly-linked lists support:
and so String
as [Char]
(unicode points) means a string type that fits the language goals (as of 1990), and essentially come "for free" with the list library.
In summary, historically the language designers were interested more in well-designed core data types, than the modern problems of text processing, so we have an elegant, easy to understand, easy to teach String
type, that isn't quite a unicode text chunk, and isn't a dense, packed, strict data type.