When do I use ByteString and when do I not?

后端 未结 2 1327
自闭症患者
自闭症患者 2021-02-05 04:38

I\'ve been making rather poor attempts at the PRIME1 problem on SPOJ. I discovered using that using ByteString really helped performance for reading in the problem text

2条回答
  •  春和景丽
    2021-02-05 05:38

    Note that performance isn't the main difference between ByteString and String. The former is for binary data while the latter is for Unicode text. If you have binary data, use ByteString, if you have Unicode text, use the Text type from the text package.

提交回复
热议问题