4 ms·
What's so good about a linked list of characters? Really, I think most people complain about bytestrings because "foo" makes a "normal string". If it made a b
by jrockway 17y ago
What's so good about a linked list of characters?
Really, I think most people complain about bytestrings because "foo" makes a "normal string". If it made a bytestring, who would care? Bytestrings do the same API that you'd expect from any traversable.
- yummyfajitas 17y agoNothing. That's my point -- strings suck, Haskell should implement strings as bytestrings or something that isn't slow.
- tumult 17y agoYou can make "foo" give you a literal ByteString instead of a [Char]. Use the OverloadedStrings GHC extension. You probably knew that already, though.
- jrockway 17y agoYeah. I thought you were saying the entire concept was worthless or something. (Incidentally, I have used plain [Char] strings in some Haskell apps, and the performance has been fine. But really, all I do is get them from a char* and print them, so...)