News for hackers. Stuff that matters.
Re:Runtime Support for Multicore Haskell: A Retrospective by marcosdumay on Tuesday December 17, 2019 @03:36PM (#21818508)
> Haskell's not great for strings

What do you mean by that?

Re:Runtime Support for Multicore Haskell: A Retrospective by mic47 on Tuesday December 17, 2019 @04:24PM (#21819009)
There are couple of implementarion of strings: * String - this is default, it is list of characters and it was a mistake. * ByteString and LazyByteString - this represents array of 8bit characters. Performant but does not handle encodings * Text and LazyText - this is what you want to use when yiu work with text, since it represent text in unicode.

There is mess in these types. s9me libraries are using different types, so you might have to convert between those and it can be confusing, and the conversion apis are not unified. But if you manage in your project consistently use single type (say Text), then you'll actually have a great time working with strings. Its problem if you want to quickly mash together few libraries that does not use same types, since it get messy.

Reason for this is mostly historic.

Re:Runtime Support for Multicore Haskell: A Retrospective by marcosdumay on Tuesday December 17, 2019 @07:15PM (#21820506)
> ByteString and LazyByteString - this represents array of 8bit characters

Not exactly. ByteString has no relation at all with text or characters. It represents a sequence of bytes, AKA binary data.

I imagined I would hear complaints about too many text types when I made that question, but it sounded like the GP had a different complaint.

The library mess is real, but it's improving quickly and it's a bad reason to decide Haskell is a bad language to deal with text. It's throwing a lot of great stuff out just because of a minor inconvenient. And by the way, one of the best things on Haskell is that you can defined a lot more text types. For example, my current project has types for internal identifiers, HTML, HTML form values, JS, and SQL, they are all text but I can always be sure things are properly encoded.

Re:Runtime Support for Multicore Haskell: A Retrospective by vmchale on Tuesday December 17, 2019 @03:53PM (#21818698)
The default String type is a linked list of characters, which means various things are slower than they should be.
Re:Runtime Support for Multicore Haskell: A Retrospective by marcosdumay on Tuesday December 17, 2019 @04:19PM (#21818954)
Hum... Yes. String is there for historical reasons that turned out to be a bad fit to what Haskell became.

But there is no reason to use it. Text does everything String does.