haskell / text

Haskell library for space- and time-efficient operations over Unicode text.

Home Page:http://hackage.haskell.org/package/text

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Guidance to conform with "Share empty Text values" change

phadej opened this issue · comments

I noticed this change in text and I wonder whether I need to do anything to conform.

In e.g. aeson we do create Text values manually (using Data.Text.Internal, especially when decoding JSON escaping) and I wonder whether I should do anything with empty values.

There is text. Should I always use it? Will something break if I don't?

EDIT: Now as I think of it, the empty Text values are not created from JSON escaping as that codepath is not taken for empty string literals. Yet, I'm still curious how much attention we (users of text internals) should pay to share empty text values?

This is an opportunistic optimisation, but there is no expectation for users to do anything to uphold it. In fact, there is no such expectation even for text contributors.

Good to know, thanks.