3 ms·
I tend to disagree. On the one hand, parts of the Haskell prelude are quite opinionated. String as a linked list? That's an impressive sort of FP purity: you c
by hyperpape 10y ago
I tend to disagree.
On the one hand, parts of the Haskell prelude are quite opinionated. String as a linked list? That's an impressive sort of FP purity: you can write tail recursive functions, and there are people out there who find that thrilling. It's just horribly space and time inefficient.
Other parts are just old. I've read that there the reason head throws an exception when applied to an empty list rather than a Maybe was because working with Maybes was much more painful when Haskell was first written. That's just ordinary backwards compatibility pain.
Other parts just seem painful for no reason whatsoever. Lazy and Strict ByteStrings/Text are both named ByteString/Text. They just live in different namespaces, so when you see code that reads "Text -> a", the only way to distinguish it is to look at what's been imported. If you couldn't decide which was preferred, they should be "StrictText"/"LazyText" (and programmers would be free to import them as Text if they so desired).
(Nevermind that Text, while essential, isn't actually part of the Prelude...).
- Chris_Newton 10y agoOther parts are just old. This must be the curse of writing a language that becomes successful enough to grow a significant user base. You will inevitably discover that some of your original decisions about language features or standard library designs aren’t ideal. However, even if you know a much better way now, you can’t just replace the existing version without breaking a lot of existing code. Worse, over time people will start writing their own libraries, and some of them will adopt the same flawed conventions as your standard library by default. C++ has long struggled with strings and text processing for similar reasons.