4 ms·
The current situation (importing ByteString or Text for performance) is pretty good IMO. Haskell doesn't have Map or Set or anything in the prelude, so I t
by seagreen 10y ago
The current situation (importing ByteString or Text for
performance) is pretty good IMO. Haskell doesn't have Map
or Set or anything in the prelude, so I think it's
reasonable to leave powerful packed text types out as well.
Interesting. Maybe all we have is a community problem then? Since `String` is right there, and `Text` is both an additional dependency and an import away `String` gets used in situations it shouldn't.
Try going to a python or java developer and telling them
"array access should return an optional type instead of
throwing an exception on out-of-bounds".
Alright, I think we have synthesis. From a Python programmers perspective the Prelude issues are somewhat trivial. From a Haskell programmers perspective it's offensive to good engineering. So it depends on your perspective:)
- tome 10y ago> Maybe all we have is a community problem then? Since `String` is right there, and `Text` is both an additional dependency and an import away `String` gets used in situations it shouldn't. Yes, that's exactly what the problem is. String gets used instead of Text because it's the path of least resistance.
- wyager 10y agoAgreed on both points. It's unfortunate that people use String just because it's there, or Int when they should use Word (because Word wasn't added to the Prelude until recently). For example, it's awful that length returns an Int. It should return a Word or be generic. Indeed, the Haskell programmer is the one I'd say lives in "the first world".