3 ms·
> String (i.e. [Char]) is inefficient unless you're doing a lot of manipulation such as insertions and deletions in the middle of the string Is String actually
by millstone 13y ago
> String (i.e. [Char]) is inefficient unless you're doing a lot of manipulation such as insertions and deletions in the middle of the string
Is String actually efficient for this use case? If you insert in the middle of a String, wouldn't it have to copy all of the preceding characters? Only the tail could be shared, I would think.
- thirsteh 13y agoYeah, it's not very efficient. I mainly use lists as stacks, or when I'm filtering some collection and I just need to traverse it.