2 ms·
It is a real thing, but it's a design decision that dates back to around 1990 when Haskell was very much purely a research language. Haskell's type class capab
by antonvs 5y ago
It is a real thing, but it's a design decision that dates back to around 1990 when Haskell was very much purely a research language.
Haskell's type class capability (similar to traits or interfaces) was still new/experimental at that time, and one benefit of strings as lists is it allowed them to easily be manipulated using the same syntactic and semantic machinery - pattern matching, recursive processing etc. - as other list data.
These days real, non-trivial code uses much more optimized string representations, but the original String type still exists and is used in various standard library functions, like "error". But as the original commenter pointed out, "you can just upgrade strings like any other dependency," so if you want, you can always import some other library that uses e.g. the Text type for error message, if you care for some reason.