Why is Haskell's default string implementation a linked list of chars?

后端 未结 3 544
误落风尘
误落风尘 2021-02-01 19:11

The fact that Haskell\'s default String implementation is not efficient both in terms of speed and memory is well known. As far as I know the [] lists

3条回答
  •  死守一世寂寞
    2021-02-01 20:02

    At this point, it's probably historical: the optimizations that have made things like ByteString so efficient are recent, whereas [Char] predates them all by many years.

提交回复
热议问题